Goal: Now that we've learned about Array.prototype.map()
, let's further hone our array mapping skills by completing the exercises detailed below.
const tripledNumbers = numbers.map(function(number) {
return number * 3;
});
map()
alter the array it is called upon?forEach()
and when it might be better to use map()
.Complete the following in the JavaScript console or on JSFiddle:
.map()
to return an array containing each of the original numbers + 1..map()
to return an array of the same words in all uppercase.
Lesson 11 of 15
Last updated March 24, 2021