Is there any difference between Jquery.each() and Array.prototype.forEach() method since array.forEach() method can also be used to loop over array-like objects with length property.The only difference i see is placement of arguments ,what else can be the difference in them?
I found this:
var obj = { one:1, two:2, three:3, four:4, five:5 };
jQuery.each(obj, function(i, val) {
$("#" + i).append(document.createTextNode(" - " + val));
});
What i wan to know is ,do jquery.each() invokes function for object without length property??