Goal: In the Looping video, we learned:
As you saw, loops can be really powerful! They're an incredibly important programming concept, and we'll be using them from here on out. Begin becoming comfortable utilizing loops by completing the exercises listed below. We'll begin with several exercises in the console, and move on to creating and updating small projects.
forEach()to loop through an array called "kittens", what should we call the parameter in the
alert()a greeting to each.
Refactor your Mad Libs page we created in this exercise to use a loop.
In the Introduction to jQuery lesson we created a web page that triggered alerts containing information about a particular HTML tag whenever a user clicked on an HTML element. Try to refactor this page's multiple, similar event listeners using a loop.
Remember: When choosing a name for the variables in your loop, remember that it is good practice to use a plural for the array and the singular form of that word for the loop.
The array is named
languages and the parameter is the singular