+ 2
JavaScript Associative Aray Length
How can i get length of associative arrays?
1 Antwort
+ 3
Well, you can use this
var myarr=new Array();
myarr["hash1"]="My first array element";
myarr["hash2"]="This is second one";
myarr["hash3"]="Yeap, its third one";
document.write(Object.keys(myarr).length);
Hope its help you