Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
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.
Try to keep your conditional statements short and precise. When conditionals become too long or complicated, they can be challenging to track and manage. In some circumstances, it may be unavoidable.
A good rule of thumb is: if you find yourself creating a lengthy and overly complicated conditional, it might be worth taking the time to work out a more explicit, alternative approach.
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
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