Last active
January 20, 2016 06:03
-
-
Save jmsevold/3abb72c76b54cae1e69b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var R = require('ramda'); | |
var list = [1,2,3,4,5]; | |
var filter = R.curry(function(func,array){ | |
return array.filter(func); | |
}) | |
var oddsOnly = function(num){ | |
return num % 2 != 0; | |
}; | |
console.log(filter(oddsOnly,list)); | |
console.log(filter(oddsOnly)(list)); | |
console.log(filter(oddsOnly)); | |
var filterWrap = function(func){ | |
return function(array){ | |
return array.filter(func); | |
}; | |
}; | |
console.log("*************************") | |
console.log(filterWrap(oddsOnly)(list)); | |
console.log(filterWrap(oddsOnly)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment