forEach for objects
This commit is contained in:
8
~/JavaScript/Object.entries.js
Normal file
8
~/JavaScript/Object.entries.js
Normal file
@ -0,0 +1,8 @@
|
||||
const object1 = {
|
||||
a: 'somestring',
|
||||
b: 42
|
||||
};
|
||||
|
||||
for (const [key, value] of Object.entries(object1)) {
|
||||
console.log(`${key}: ${value}`);
|
||||
}
|
Reference in New Issue
Block a user