JS Loop над объектом
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]}`);
}
for (var [key, value] of phoneBookMap) {
console.log(key + "'s phone number is: " + value);
}
function foo(abc: ABC) {
let k: keyof ABC;
for (k in abc) {
const v = abc[k];
}
}
for (let key in yourobject) {
if (yourobject.hasOwnProperty(key)) {
console.log(key, yourobject[key]);
}
}