Jquery.each() 和 Array.prototype.forEach() 方法之间是否有任何区别,因为 array.forEach() 方法也可以用于循环具有长度属性的类数组对象。我看到的唯一区别是参数的放置,他们还有什么不同?
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));
});
我想知道的是,jquery.each() 是否为没有长度属性的对象调用函数?