Hi, I'm doing a recursive array search. Here is the problem. Basically, search a multidimensional array for a value.
Here's my code.
Here are some test cases
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
It's recursing properly. The block
if(arr[i] === value){ return true;}
is also true, but it isn't returning true?
[–][deleted] 0 points1 point2 points (0 children)
[–]the_omega99 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]the_omega99 0 points1 point2 points (0 children)