JavaScript branches
the decision makers (the "case" makers)
Branches make decisions with data based on cases:
if
if
Accounting for a situation:
if/else
if/else
Accounting for an either-or situation:
if/elseif/else
if/elseif/else
Accounting for a non-binary situation:
switch
switch
A more aesthetically-pleasing "synonym" of the if/elseif/else
structure:
Compare the keywords from the if/elseif/else
and the switch
Last updated