Tuesday, 4 July 2017

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

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...