Last active
August 20, 2017 00:51
-
-
Save isacjunior/d0440454b699e51134e3db4d02131f1e 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 filter(array, test) { | |
const passed = [] | |
for (var i = 0; i < array.length; i++) { | |
if(test(array[i])) | |
passed.push(array[i]) | |
} | |
return passed | |
} | |
const filterAgeEx5 = filter(users, user => user.age > 50) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment