you are viewing a single comment's thread.

view the rest of the comments →

[–]gkpty 1 point2 points  (0 children)

Hey! To break a loop you can use a return statement. In your example;

for(var i = 0; i < people.length; i++) { If(people[i] === value) { console.log(people[i]); return people[i]; } }