JS Loop Over Object
const object = {a: 1, b: 2, c: 3};
for (const property in object) {
console.log(`${property}: ${object[property]}`);
}
Navid2zp
const object = {a: 1, b: 2, c: 3};
for (const property in object) {
console.log(`${property}: ${object[property]}`);
}
var person={
first_name:"johnny",
last_name: "johnson",
phone:"703-3424-1111"
};
for (var property in person) {
console.log(property,":",person[property]);
}
//Loop thru DOM elements
var all = document.getElementsByTagName("*");
for (var i=0, max=all.length; i < max; i++) {
// Do something with the element here
}
Array.from($('.'+$( this ).attr('id'))).forEach(function(obj){
console.log(obj);
});