Doing:
var tags = ["foobar", "hello", "world"];
$.each(tags, function(tag) {
console.log(tag);
});
Gives me an output of
0
1
2
Why is my output not
foobar
hello
world
Do this, the first parameter is for index:
$.each(tags, function(index, tag) {
console.log(tag);
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.