Goal: In the Looping lesson, we learned:
Array.prototype.forEach()
loop.As we can see, looping is an incredibly important programming concept. Now it's time to practice. We'll begin with two looping exercises in the console and then move on to creating a small project.
Array.prototype.forEach()
to loop through an array called "kittens", what should we call the parameter in the Array.prototype.forEach()
function? Why?+=
operator do?Complete both of the exercises listed below.
console.log()
a greeting to each friend in the array.document.createElement()
and Element.append()
or Element.prepend()
methods to create and add elements to your webpage.