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 Practice forEach in JavaScript!
You have completed Practice forEach in JavaScript!
Preview
Let's walkthrough the solution to the third code challenge.
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
And then we need to add them all together,
0:00
storing the total in
the variable named total.
0:01
I'll start with copy and
pasting the code for
0:04
this challenge into Atom in order
to make the code easier to read.
0:06
Again, I started by adding
the call to the forEach method.
0:14
And then the anonymous callback
function using arrow function syntax.
0:17
So, stringPrices.forEach.
0:21
And I use stringPrice for the current
value parameter name, followed by a fat
0:26
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