Skip to content

Instantly share code, notes, and snippets.

@captainkovalsky
Created July 20, 2015 22:54
Show Gist options
  • Save captainkovalsky/baf5e149d6efc690f8d7 to your computer and use it in GitHub Desktop.
Save captainkovalsky/baf5e149d6efc690f8d7 to your computer and use it in GitHub Desktop.
function applyFilter(filters){
var f1 = function(phone){
return phone.price >= 60;
};
var f2 = function(phone){
return phone.price <= 70;
};
var phones = [{price: 61, name: '1'}, {price: 89, name: 'exclude'}, {price: 67, name: '2'}];
var filtered = phones.filter(f1).filter(f2);
console.log('result every ', filtered);
}
@captainkovalsky
Copy link
Author

I've found solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment