0

For..In loops in JavaScript - key value pairs

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

for (const [key, value] of Object.entries(test)) {
  console.log(key, value);
}

/*
"a",1
"b",2
"c",3
*/
RUN
add comment
Suggest a different solution or add another example