The functional style looping/mapping technique seems puzzling to me without the ability to use break and continue keywords.
I find myself faced with this dilemma:
collections.users.models.forEach(function(item, index) {
//unable to implement break or continue...?
});
Alternatively, I can try this approach:
for (var i = 0; i < collections.users.models.length; i++) {
if (user.username === collections.users.models[i].username) {
app.currentUser = collections.users.models[i];
break;
}
}
What exactly is the advantage of using a functional call when break or continue aren't available?