Skip to content

Instantly share code, notes, and snippets.

@why-jay
Created December 27, 2014 16:09
Show Gist options
  • Save why-jay/97b9c4ff5e58fae136ef to your computer and use it in GitHub Desktop.
Save why-jay/97b9c4ff5e58fae136ef to your computer and use it in GitHub Desktop.
function filterNamesContaining(someStr, names) {
let rtn = [];
for (let name of names) {
if (name.indexOf(someStr) !== -1) { rtn.push(name); }
}
return rtn;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment