hugo-robles
11/30/2018 - 6:17 PM

Ternary Expresión


// If Else
test ? expression1 : expression2

// If Else without {}
if (now.getHours() > 17)
   greeting += " evening.";
else
   greeting += " day.";
   
// If Else with return variable
var s = (x != null) ? x : "";