how to iterate through properties of a javascript array code example
Example 1: javascript loop through object
for (var property in object) {
if (object.hasOwnProperty(property)) {
// Do things here
}
}
Example 2: for in loop javascript
var person = {"name":"taylor","age":31};
for (property in person) {
console.log(property,person[property]);
}
//name taylor
//age 31