$.each + strings

$.each + strings


I found out something interesting tonight. I learned that $.each on a
string produces an undefined character:
$.each( mask, function(i,c){
//in IE c is undefined, but in other browsers it's actually a
character
});
I'm guessing it's because IE won't allow mask[i] but only
mask.charAt(i). Was $.each intended to loop over strings?
I'm not sure if it's a bug, so I just thought I'd point this out. My
fix was to say "c=c||mask.charAt(i);" immediately inside of my loop
function. I also noticed similar behavior in $.map over a string.
Thanks
Josh
digitalbush.com