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
JavaScript 2025 · Objects and data
Iterate over keys and values.
for (const [key, value] of Object.entries(obj)) {
console.log(key, value);
}
Official JavaScript 2025 documentation
Was this page helpful?