Javascript Recursive Search Array Python Methods