Day 4: Loops
Wrap up
Looping is one of the hardest things to get your head around when learning to code. It took me several attempts to start to even feel vaguely comfortable with the concept. The best way to practice is to write lots of loops!
In the playground below practice a few ways of looping:
Challenge
You know how to create arrays, you know how to create objects, no let's loop over an array of objects.
Here is a stripped down version of our laptop specs from earlier. Use two types of loops (for
and for of
) to loop through, printing the name and storage size of each laptop.