What does return do in a loop?


#1

if(friends[i].firstName === name) {
console.log(friends[i]);
return friends[i];

I dont understand where it is returning it and what is the purpose of returning?


#2

#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.