Skip to content

Instantly share code, notes, and snippets.

@jeromelachaud
Created July 27, 2016 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeromelachaud/e6e567d70bc5ae65467c5d1845c4f5b3 to your computer and use it in GitHub Desktop.
Save jeromelachaud/e6e567d70bc5ae65467c5d1845c4f5b3 to your computer and use it in GitHub Desktop.
var comics = [
{
pages: 100,
price: 100
},
{
pages: 100,
price: 50
},
{
pages: 50,
price: 10
}
];
var filterLte50 = _.filter(function(num) {
return num <= 50;
});
var filterLt100 = _.filter(function(num) {
return num < 50;
});
var filterPriceLte50 = _.flowRight([filterLte50, _.map(_.prop('price'))]);
var filterPagesLt100 = _.flowRight([filterLt100, _.map(_.prop('pages'))]);
console.log(filterPagesLt100(comics));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment