Created
December 27, 2014 15:40
-
-
Save why-jay/5c0fc7f7e59216317115 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 filterNamesContaining(someStr, names) { | |
// filter out names that contain `someStr` as a substring | |
return names.filter(name => name.indexOf(someStr) !== -1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment