Pętla JS nad obiektem
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]}`);
}
const array1 = ['a', 'b', 'c'];
for (const element of array1) {
console.log(element);
}
for (variable in object) {
statement
}
for (variable in object) {
statement
}
for (variable in object) {
statement
}
for (variable in object) {
statement
}