Why my for for-each loop is not iterating over my JavaScript associative array object?
// defining an array
var array = [];
// assigning values to correspon
var obj = {
no: ["no", 32],
nt: ["no", 32],
nf: ["no", 32, 90]
};
count = -1; // which must be static value
for (i in obj) {
count++;
if (obj.hasOwnProperty(i)) {
console.log(obj[i][count])
};
};
in this code i used brackets method for call values in array because it contained array , however briefly the idea which a variable i has a key of property and with a loop called both values of associate array
perfect Method , if you interested, press like