I will expand on @Avaq's answer a bit here. You don't need lib like Rambda to start using currying. You can start doing this with ES6 today.
It seems you already understood the concept here. This is already a curry function. (Each sequenced function takes only one argument)
function isGreaterThan(value) { return function(original) { return value < original; } }
With the ES6 arrow function, this is much easier.
const gt = x => y => y > x;
Notice how you turned the > operator on < in your function to make use more natural? It is very common with curried functions to first take an operand that is least likely to change. With gt I think itβs better to use > here, as this is the name of our function, but flip the operands instead. That's why you see me returning y > x instead of x > y . gt(5) returns the function y => y > 5 , which is very natural for me.
Without further ado, see if this works in filter
[1,2,3,4,5,6].filter(gt(3));
If you need this to work in the ES5 environment, you can easily pass it to babel . The result should look very familiar.
"use strict"; var gt = function gt(x) { return function (y) { return y > x; }; };
And with this you are on the verge of functional programming. There are many interesting things to learn. With the problem that we discussed here, I think it will be interesting for you to learn about the structure of functions below.
Here is the basic composition to increase your appetite
// filter out odd numbers const mod = x => y => y % x; const eq = x => y => y === x; const comp = f => g => x => f(g(x)); const isEven = comp (eq (0)) (mod (2)); [1,2,3,4,5,6].filter(isEven); //=> [2,4,6]