This lab includes an opportunity to iterate with for
loops. All the tasks in Part A will require a for
loop.
JavaScript also includes some built-in methods for array iteration, and some of the most useful are:
.map()
, which iterates and returns a parallel copy of the array, usually modified in some way..filter()
, which iterates and returns a subset of the values in the original array..forEach()
, which iterates and returns nothing.
Feel free to do all the Part B tasks with a traditional for
loop. If you want a challenge, you can try to use .map()
, and for an even more significant challenge, try one of the others.
Part C includes only challenges.