Answers for "for key value object js"

4

iterate key value object javascript

'use strict';
// ECMAScript 2017
const object = {'a': 1, 'b': 2, 'c' : 3};
for (const [key, value] of Object.entries(object)) {
  console.log(key, value);
}
Posted by: Guest on September-02-2020
4

for key value in object javascript

for (const [key, value] of Object.entries(object1)) {
  console.log(`${key}: ${value}`);
}
Posted by: Guest on December-09-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language