Tuesday, October 1, 2019

javascript - why does $.each() not work with arrays that have a string index in jquery?

version a:






var x = [];
x['abc'] = 'd';
x['xyz'] = 'abbb';
$.each(x, function(i, el) {
console.error(el);
});







does not work. No output in console see here:



How can I make version a work?

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...