Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript if shorthand

condition ? doThisIfTrue : doThisIfFalse

1 > 2 ? console.log(true) : console.log(false)
// returns false
 
PREVIOUS NEXT
Tagged: #javascript #shorthand
ADD COMMENT
Topic
Name
3+2 =