Hi, I've looked through the tutorial on w3cschools.com, but I'm still
uncertain as to the difference between using break and using return.
If I have a simple "for" loop that I want to stop if a condition is
met, should I use break or return to stop the loop?
e.g. is something like this ok? Would using return do the same thing?
var dow = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday',
'Saturday', 'Sunday'];
var d = 'Wednesday';
for(var i = 0; i < dow.length; i++){
if (dow[i] == d){
var abc = dow[i];
break;
}
}