I was looking at the code in angular 1.3.4 for angular.forEach and it looks like the following...
function forEach(obj, iterator, context) {
...
for (key = 0, length = obj.length; key < length; key++) {
if (isPrimitive || key in obj) {
iterator.call(context, obj[key], key, obj);
}
...
return obj;
}
But according to this link, it is faster to use decrement. So should I switch over to a pure javascript for loop? Why does the Angular team increment if performance is an issue? or is there a way (short of rewriting) to get angular.forEach to do this?