JavaScript 2025 · Objects and data

Loop over an object

Iterate over keys and values.

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

Official JavaScript 2025 documentation

More objects and data commands

All objects and data commands · JavaScript 2025 cheatsheet

Was this page helpful?