js ternary if else

JavaScript
condition ? ifTrue : ifFalsevar variable;
if (condition)
  variable = "something";
else
  variable = "something else";

//is the same as:

var variable = condition ? "something" : "something else";ternary if else example
Source

Also in JavaScript: