Created
March 18, 2019 22:18
-
-
Save matthew-gerstman/6ec04a34ba7d97df3e8f9677c20fe9e5 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
function filter(list, predicate) { | |
return list.reduce((acc, item) => { | |
if (predicate(item)) { | |
acc.push(item); | |
} | |
return acc; | |
}, []); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment