Let's assume that we declare the following object:
javascriptlet team = { 'Steve': 'Apple', 'Bill': 'Microsoft', 'Jeff': 'Amazon', 'Elon': 'Tesla' }
Each CEO belongs to a different company.
As in the future they will work for Erik Inc.
, we need to change each value of the object:
javascriptObject.keys(team).forEach(name => team[name] = 'Erik Inc.'); console.log(team); // {Steve: 'Erik Inc.', Bill: 'Erik Inc.', Jeff: 'Erik Inc.', Elon: 'Erik Inc.'}
My future looks promising. 😎
Hi, I'm Erik, an engineer from Barcelona. If you like the post or have any comments, say hi.