Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

ternary operator in javascript

//if there is complex statement use if statement 
//otherwise ternary operator will be best to use.
condition ? true Condition : false Condition
9<10 ? "small":"bigger" // small code run
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #ternary #operator #javascript
ADD COMMENT
Topic
Name
3+3 =