DEV Community

Discussion on: Back to Basics: Loops in JavaScript

Collapse
 
chety profile image
Chety

Hi Alisa,

Nice and concise write up. Thanks for your efforts. I want to add one thing. In your for..in section I think you should add below code:

[foodIAte["lunch"], foodIAte["dinner"]] = [foodIAte["dinner"],foodIAte["lunch"]];
console.log(foodIAte); // {breakfast: 'eggs', lunch: 'pizza', dinner: 'salad'}
Enter fullscreen mode Exit fullscreen mode

See it is much more healthier now :)