Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 1.33 KB

File metadata and controls

20 lines (14 loc) · 1.33 KB

search in multidimensional array

Provider Source Solutions
Codewars 52840d2b27e9c932ff0016ae JavaScript

Write a function that gets a sequence and value and returns true/false depending on whether the variable exists in a multidimentional sequence.

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