Answers for "loop of object"

85

javascript loop through object

Object.entries(obj).forEach(
    ([key, value]) => console.log(key, value)
);
Posted by: Guest on February-15-2020
4

javascipr for of

const array1 = ['a', 'b', 'c'];

for (const element of array1) {
  console.log(element);
}

// expected output: "a"
// expected output: "b"
// expected output: "c"
Posted by: Guest on September-16-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language