Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript one line if else

var res = 1 == 1 ? 'true' : 'false' // res = true 
var res = 1 == 2 ? 'true' : 'false' // res = false
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #line
ADD COMMENT
Topic
Name
6+8 =