$.each(["foo","bar"],function(){console.debug(this);});
converts "foo" and "bar" of a string type to their equivalent in a string object.
while...
$.each(["foo","bar"],function(i,e){console.debug(e);});
will store "foo" and "bar" in the original string type.
I wonder why $ .each does the conversion? And, moreover ... if this conversion never happens - leave the strings as they are, whether they are a string type or a string object?
source
share