Created
July 20, 2015 22:54
-
-
Save captainkovalsky/baf5e149d6efc690f8d7 to your computer and use it in GitHub Desktop.
This file contains 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
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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've found solution