Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed JavaScript Array Iteration Methods!

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
Use the map method to transform elements in an array.
Snippets from the Video
const strings = ['1','2','3','4','5'];
const fruits = ['apple', 'pear', 'cherry'];
let capitalizedFruits = [];
fruits.forEach(fruit => {
let capitalizedFruit = fruit.toUpperCase();
capitalizedFruits.push(capitalizedFruit);
});
console.log(capitalizedFruits);
const prices = [5, 4.23, 6.4, 8.09, 3.20];
// Result: [ '$5.00', '$4.23', '$6.40', '$8.09', '$3.20' ]
MDN Resources
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Peter Huang
5,427 Points2 Answers
-
karan Badhwar
Web Development Techdegree Graduate 18,135 Points1 Answer
-
Kaung Khant Zaw
1,515 Points1 Answer
-
Ewerton Luna
Full Stack JavaScript Techdegree Graduate 24,031 Points1 Answer
-
James Roberts
16,976 Points1 Answer
-
Khumoyunmirzo Nosirov
8,689 Points1 Answer
-
ammarkhan
Front End Web Development Techdegree Student 21,661 Points2 Answers
-
Rachel Heneault
12,401 Points2 Answers
-
Tony Brackins
28,766 Points2 Answers
-
Tim Strand
22,458 Points1 Answer
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up