Solution: Going Loopy Over Arrays
Review solutions to the tasks from the going loopy over arrays challenge.
We'll cover the following...
We'll cover the following...
Solution 1
Here is a possible solution for the capitals function that uses the map to return a new array of the same words written in uppercase.
Explanation
Line 1: Declares a constant variable
arrand assign it an array containing five strings.Line 3–5: Defines a function called
capitalsthat takes an array as an argument. Inside the function:...