var add = function(x) {
return function(y) {
return x + y;
}
}
var increment = add(1);
console.log(increment(2));
var addTen = add(10);
console.log(addTen(5));
var curry = _.curry;
var match = curry(function (what, str) {
return str.match(what);
})
var replace = curry(function(what, replacement, str) {
return str.replace(what, replacement);
})
var filter = curry(function(f, ary) {
return ary.filter(f)
})
var map = curry(function (f, ary) {
return ary.map(f)
})
var hasSpaces = match(/\s+/g);
var findSpaces = filter(hasSpaces);
var noVowels = replace(/[aeiou]/ig);
var censored = noVowels('*');
var a = match(/\s+/g, "helloworld");
var a1 = hasSpaces("hello world");
console.log(a1);
var a2 = findSpaces(['abc_123', 'go go']);
console.log(a2);
var a3 = censored('chocolate rain');
console.log(a3);
console