JSFiddle - React, Tailwind, and code Playground
by Vignesh Gopalakrishnan
JavaScript
function curry(uncurried) {
var args = Array.prototype.slice.call(arguments, 1);
return function() {
debugger
return uncurried.apply(this, args.concat(
Array.prototype.slice.call(arguments, 0)
));
};
};
function filterCollection(filter_fn ,collection) {
debugger
return collection.filter(filter_fn);
};
var greaterThan5 = curry(filterCollection,function(x){return x>5});
greaterThan5([3,4,5,6,7]); //[6,7]