I writing this, because it’s driving me crazy, and I don’t know how its possible:
My code
var categories = new Array(length);
for (i = 0; i < length; ++i)
{categories[i] = new Array (2);}
$(".lang-box").each(function(i) {
if( i < categories.length) {categories[i][0] = $(this).attr('name');categories[i][1] = $(this).val();}
});
How is it possible if I do:
console.log(categories.lenght);
I get “undefined”, but if I do
console.log(categories);
I get:
[ ["pl","fwer"],["en",""]]
How is this possible?
Simple fix. If you change
… to …
it should work fine.