functionaljs / functional-js

A functional JavaScript library that facilitates currying and point-free programming
223 stars 14 forks source link

Lambdas are just reimplements of ES6 arrow functions #10

Closed iddan closed 7 years ago

iddan commented 7 years ago

Reminding you this is valid now:

const f = (a, b) => a + b;
leecrossley commented 7 years ago

Correct, this library intentionally doesn't extend or depend on any of ES5+'s features, such as arrow functions, to prevent conditionalised implementations for different browsers or force transpiling. You're obviously free to use arrow functions with functional js if your environment permits it, such as the example in the readme:

Curry ES6 example

const add = fjs.curry((a, b) => a + b);

const add3 = add(3);

add(1, 2, 3); // => 6
add3(1, 2, 3, 4, 5); // => 18