jQuery.each on array of strings or numbers and this in callback
Hi,
I noticed that jQuery.each(['abc', 'cde'], function() { ... }), the
"this" in the callback work as the strings in the array, but are
indeed objects if you use typeof() to check. if I use the function(i,
v) {} form of the callback, the v is then correctly the original
primitive in the array.
Is this (the object-wrapped this) the intended behaviour? If so the
example in the callback argument in http://docs.jquery.com/Utilities/jQuery.each#objectcallback
is incorrect as it states "this; // == valueOfElement"
The same problem applies for jQuery.map, but i'd imagine it's because
it's implemented with each.
Cheers,
CLK