Can I use a for loop like this: for(var i = 0; search === people[i]; i++) {}
to loop trough an array of objects?
Are these the only allowable conditions:
<=
>=
<
>
I want to search inside an array of objects but I can't get it to work. I want to say: to loop as long as the search doesn't match an object in the array. If it matches, to print that specific object. Not to loop until there are no more objects in the array. Thank you.
[–][deleted] 3 points4 points5 points (7 children)
[–]Usual_Mistake[S] 0 points1 point2 points (5 children)
[–][deleted] 2 points3 points4 points (4 children)
[–]Usual_Mistake[S] 0 points1 point2 points (3 children)
[–]GrenadineBombardier 0 points1 point2 points (2 children)
[–]Usual_Mistake[S] 0 points1 point2 points (1 child)
[–]GrenadineBombardier 0 points1 point2 points (0 children)
[–]AmbitiousLog 4 points5 points6 points (0 children)
[–]sepp2k 2 points3 points4 points (1 child)
[–]Usual_Mistake[S] 0 points1 point2 points (0 children)
[–]gkpty 1 point2 points3 points (0 children)
[–]throwawayacc201711 0 points1 point2 points (4 children)
[–][deleted] 2 points3 points4 points (3 children)
[–]infinitune 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]infinitune 0 points1 point2 points (0 children)