Skip to content

Functions

Sasa Bogicevic edited this page May 14, 2017 · 6 revisions

Functions

compose

You can compose two or more functions together. They will be evaluated from right to left.

  function mult2(x){return x * 2;}
  function add1(x){return x + 1;}
  var composition = F.compose(add1, mult2);
  composition(2) -> 5

curry

Read more about currying here

  function mult2(x,y){return x * y;}
  var multiplicator = F.curry(mult2);
  multiplicator(2); -> Function
  multiplicator(3); -> 6

haskell

Clone this wiki locally