Logical Operators AND and OR with Compound if statements

preview_player
Показать описание
Sometimes you need to ask multiple questions when setting up an if statement. You need an if statement that uses the logical AND operator or the logical OR operator.

&& - AND
|| - OR

Examples:
if num is greater than 10
AND
num is less than 20 - number is inside the range 10 to 20

if num less than 10
OR
num greater than 20 - number is outside the range 10 to 20

Рекомендации по теме
Комментарии
Автор

You are an excellent teacher.
Thanks for these videos.

sirousmohseni
Автор

Hello Steve, where can you find the or II in the keyboard?

nowyouknow..
Автор

Doubt in the line 9 & 10

What is the mean of let ?

\\ I’m fresher

saravanakumar-bzue
Автор

() aren't always for clarity - Tomato && onion || cheese - is that Tomato && (onion || cheese) or (tomato && onion) || cheese - two very different questions.

gginnj
Автор

Good evening Steve, Thanks for the amazing videos you are making. I am using chrome console and codepen and when I try this I get true or false, not the console.log. What am I doing wrong? Thanks.

DmitriyMalayevProfile