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 = [0,3,6,9].map(function(number) {
return number * 3;
});
Array.prototype.map()
alter the array it is called upon?Array.prototype.forEach()
and when it might be better to use Array.prototype.map()
.Complete the following in the JavaScript DevTools console:
Array.prototype.map()
to return an array containing each of the original numbers + 1.Array.prototype.map()
to return an array of the same words in all uppercase.