DEV Community

Discussion on: How to iterate over an object in Javascript?

Collapse
 
rickdelpo1 profile image
Rick Delpo

we can use Object.keys with method .forEach

Object.keys(object).forEach(key => {
console.log(key, object[key]);
});

Collapse
 
rakshit profile image
Rakshit

Thanks. Would be of great use for those who read this article :)