Javascript - Flow (Control Structures)

About

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

Documentation / Reference


Powered by ComboStrap