Skip to content

Instantly share code, notes, and snippets.

@Takeno
Created November 17, 2015 17:19
Show Gist options
  • Save Takeno/2b854e1f479dbe10bedf to your computer and use it in GitHub Desktop.
Save Takeno/2b854e1f479dbe10bedf to your computer and use it in GitHub Desktop.
Locate JS

Write a function named "locate" that gets an array and value and returns true if specified value exist in a multidimentional array.

Example:

locate(['a','b',['c','d',['e']]],'e'); // should return true
locate(['a','b',['c','d',['e']]],'a'); // should return true
locate(['a','b',['c','d',['e']]],'f'); // should return false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment