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 Quickstart!
You have completed JavaScript Quickstart!
Preview
Like forEach, for...of creates loop that repeats an action a given number of times.
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
for of creates a loop that repeats
an action a given number of times.
0:00
You create a for
of loop with the keyword, for
0:00
followed by a parentheses and
curly braces.
0:05
Inside the parentheses, you provide for
0:09
of a variable that represents the current
item being processed in the loop.
0:12
This is very similar to the movie
parameter we just used inside for each.
0:16
So I'll again call the variable
movie with var movie, and
0:21
you could also the let and const keywords
I mentioned earlier here in place of var.
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