Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

ternary function javascript

var variable;
if (condition)
  variable = "something";
else
  variable = "something else";

//is the same as:

var variable = condition ? "something" : "something else";
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #ternary #function #javascript
ADD COMMENT
Topic
Name
3+3 =