search

Home  >  Q&A  >  body text

javascript - Is it difficult to understand the use of api in ramda?

I’ve been looking at functional programming recently. The ramda library is used.

But the use of various APIs is confusing.

  var func3=_.compose(p,trace("f3:"), f);
  var func4=_.filter(_.compose(p,trace("f4:"), f));
  console.log(func3(3))//36
  console.log(func4([3]))//[3] why? what happened
滿天的星座滿天的星座2697 days ago738

reply all(1)I'll reply

  • 某草草

    某草草2017-07-05 10:44:21

    Ramda will be automatically curried, is it understandable?

    _.filter(func3, [3])

    func3(3) returns 36, which is true, so filter it again and 3 is still there

    reply
    0
  • Cancelreply