[英]What is the difference between these two Javascript arrays?
First one is mutated after logging, second one is logged after mutating. 第一个在记录后发生突变,第二个在发生变化后记录。 Try the following in the console:
在控制台中尝试以下操作:
var arr = [];
console.log(arr);//will log [] but can expand to an item with name 'one'
console.table(arr);//the actual value of arr at the time of logging
console.log(JSON.stringify(arr));//also actual value when logging
arr.push({name:'one'})
I believe .each returns an object with the value. 我相信.each返回带有值的对象。 So if you where to get the type of the $el than it would return obj and not number.
因此,如果在何处获取$ el的类型,则它将返回obj而不是数字。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.