Python to JS translate, searching for objects in an array

Auto translate was working, my variable just wasn’t global here is the solution.