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 Basics!
You have completed JavaScript Basics!
Preview
There are times you'll want to perform an action if either of the two possible conditions is true. In this video, you'll use the logical OR (|| ) operator to test multiple conditions.
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
There are times you'll want to perform
an action if either of two possible
0:00
conditions are true.
0:00
For example, if it's hot or the indoor
pool is open, then I'll go swimming.
0:01
In this case,
either condition can be true.
0:07
It might be really cold outside, but
the indoor pool is heated and warm, so
0:09
I'll go swimming.
0:13
On the other hand, the indoor pool
may be closed but it's hot so
0:14
I'll go swimming in the ocean.
0:18
To run this type of test,
you use the or operator.
0:20
It's called or because the entire
condition returns true if either
0:24
condition one or
condition two evaluates the true.
0:29
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