Javascript - Flow (Control Structures)

About

Flow / Conditional expression in Javascript

Statement

If

var iceCream = "chocolate";
if (iceCream == "chocolate") {
  console.log("Yay, I love chocolate ice cream!");    
} else {
  console.log("Awwww, but chocolate is my favorite...");    
}

Ternary

Language - Conditional operator (ternary) in Javascript

foo = ( 1==1 ? true : false )
console.log(foo)

Loop

See loop

Switch

How to use the Switch Statement in Javascript?

Documentation / Reference







Share this page:
Follow us:
Task Runner