... more specefically, is it possible to break out of a forEach loop. In the code below the return statement in the if statement appears to do nothing.
This is because it is retuning to the callback function.
Here is a reference:
// underscore equivalent "cornerstone" fails b.c. of storage duality
var newForEach = function (obj, func, con) {
if (Pub.isType("Function", func)) {
Object.keys(obj).forEach(function (key) {
if (func.call(con, obj[key], key, obj)) {
return true;
}
});
}
};
Note, I'm not interested in using another method. I'm curious as to where the return value goes.