Does the “return” command stop a loop if the statement is false ?
For example
for (let i = 0; i < contacts.length; i++) {
if (name == contacts[i].firstName && contacts[i].hasOwnProperty(prop)){
return contacts[i].prop;
in the above scenario it should return “contacts[i].prop;” if the statement is True. But, what if it isn’t does it then go back into the loop ?
Or
Does the “return” command always stop the loop