[英]jQuery .each() not iterating over array of strings as expected
这样做:
var tags = ["foobar", "hello", "world"];
$.each(tags, function(tag) {
console.log(tag);
});
给我一个输出
0
1
2
为什么我的输出没有
foobar
hello
world
这样做,第一个参数是索引:
$.each(tags, function(index, tag) {
console.log(tag);
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.