Answers for "loop over object es6"

2

es6 loop through object

for (var [key, value] of phoneBookMap) {
  console.log(key + "'s phone number is: " + value);
}
Posted by: Guest on July-13-2020
18

js loop over object

const object = {a: 1, b: 2, c: 3};

for (const property in object) {
  console.log(`${property}: ${object[property]}`);
}
Posted by: Guest on April-10-2020
1

tepescript loop object

function foo(abc: ABC) {
  let k: keyof ABC;
  for (k in abc) {  
    const v = abc[k];  
  }
}
Posted by: Guest on December-31-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language