Skip to content

Instantly share code, notes, and snippets.

@fitsum
Last active April 26, 2024 05:10
Show Gist options
  • Select an option

  • Save fitsum/fa0f603511ba2af458f0e4b7e57ac8dd to your computer and use it in GitHub Desktop.

Select an option

Save fitsum/fa0f603511ba2af458f0e4b7e57ac8dd to your computer and use it in GitHub Desktop.
find in array
f = function(needle,haystack,collect){
collection = [];
haystack.filter(function(item){
if(typeof item === "string" && item.match(needle)!== null)
collect += item;
})
return collect;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment