Conditions

suggest change

if and else choose code based on whether a condition is truthy or falsy, not only on the booleans true and false. This section covers conditionals, Boolean logic, and the conditional operator.

Remarks

Conditions can break normal program flow by executing code based on the value of an expression. In JavaScript, this means using if, else if and else statements and ternary operators.

Ternary operators

Switch statement

if-else

Strategy pattern

do ... while loop

&& and || as conditional statements

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents