item只是数组或集合遍历中的元素的变量,例如:
var arr = [1, 2, 3]
for(var item in arr) { // item遍历数组时为数组的下标,遍历对象时为对象的key值
console.log(item) // 0, 1, 2
}
$(selector).each(function(item,element))
原创 | 2022-10-13 13:21:47 |浏览:1.6万
item只是数组或集合遍历中的元素的变量,例如:
var arr = [1, 2, 3]
for(var item in arr) { // item遍历数组时为数组的下标,遍历对象时为对象的key值
console.log(item) // 0, 1, 2
}
$(selector).each(function(item,element))