Consider this example:
Here's another version with a primitive curry function:
const samples = ["foo", "bar"];
const exclude = function(item,str) {
return item !== str;
}
function curry(func){
return function(var1){
return function(var2){
return func(var1,var2);
};
};
}
console.log(curry(exclude)('foo')('bar')); // true
console.log(samples.filter(curry(exclude)('foo'))); // ["bar"]