mdn/js/1_javascript_building_blocks/0_conditionals

0_conditionals

dz / mdn / js / 1_javascript_building_blocks / 0_conditionals

Summary

conditionals: making decisions in your code

Node Tree

Nodes

conditionals
content conditionals
children if_else, logical_operators, nesting, switch_statement, ternary_operator, values_that_return_true

if_else
content if/else
children else_if
parents conditionals

else_if
content else if
parents if_else

values_that_return_true
content any value that isn't false, undefined, null, 0, NaN, or an empty string returns true
parents conditionals

nesting
content nesting
parents conditionals

logical_operators
content logical operators
children and_or_not
parents conditionals

and_or_not
content AND/OR/NOT
parents logical_operators

ternary_operator
content Ternary Operator
parents conditionals

switch_statement
content Switch Statement
parents conditionals