js遍历
var arr1 = ['zs', 'ls', 'ww'] arr1.forEach(function ( item,index,array ) { console.log(item, index); console.log(array);
})
jquery 参数记忆方法,jq是为了更好的兼容ie,刚好对应参数首字母 $(selector).each(function(index,element){ console.log(index) })
js遍历
var arr1 = ['zs', 'ls', 'ww'] arr1.forEach(function ( item,index,array ) { console.log(item, index); console.log(array);
})
jquery 参数记忆方法,jq是为了更好的兼容ie,刚好对应参数首字母 $(selector).each(function(index,element){ console.log(index) })
转载于:https://juejin.im/post/5c7e62b66fb9a049e702db8c