Doing:
var tags = ["foobar", "hello", "world"]; $.each(tags, function(tag) { console.log(tag); });
Gives me a conclusion
0 1 2
Why is my conclusion not
foobar hello world
Jsfiddle
Do this, the first parameter for the index:
$.each(tags, function(index, tag) { console.log(tag); });