JavaScript Loop melalui objek
for (var property in object) {
if (object.hasOwnProperty(property)) {
// Do things here
}
}
Bald Eagle
for (var property in object) {
if (object.hasOwnProperty(property)) {
// Do things here
}
}
const object = { a: 1, b: 2, c: 3 };
for (const property in object) {
console.log(`${property}: ${object[property]}`);
}
var obj = {a: 1, b: 2, c: 3};
for (const prop in obj) {
console.log(`obj.${prop} = ${obj[prop]}`);
}
// Salida:
// "obj.a = 1"
// "obj.b = 2"
// "obj.c = 3"
Array.from($('.'+$( this ).attr('id'))).forEach(function(obj){
console.log(obj);
});