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 Exploring JavaScript Conditionals!
You have completed Exploring JavaScript Conditionals!
Preview
Introduction to the switch statement
Resources
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
This switch statement is used for
multiple branching logic.
0:00
So let’s skip over our two way branch and
0:01
pull up the multi-way branch
an example for this video.
0:04
Remember, we signed a value
to a variable called day.
0:08
The we have several conditions for
the value.
0:13
Let's go ahead and
comment out all these lines.
0:16
So we can refer to it later and
it won't interfere with our work.
0:20
Switch is similar in some
ways to an if statement.
0:25
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