Skip to content

Instantly share code, notes, and snippets.

@why-jay
Created December 27, 2014 15:40
Show Gist options
  • Save why-jay/5c0fc7f7e59216317115 to your computer and use it in GitHub Desktop.
Save why-jay/5c0fc7f7e59216317115 to your computer and use it in GitHub Desktop.
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