Mapping an Object

PHOTO EMBED

Tue May 05 2020 04:59:33 GMT+0000 (Coordinated Universal Time)

Saved by @sid #javascript

const object1 = {
  a: 'somestring',
  b: 42
};

for (let [key, value] of Object.entries(object1)) {
  console.log(`${key}: ${value}`);
}
content_copyCOPY

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries