Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

if statemnt shorthand js without else

//else if statement shorthand
y = (x === 2) ? 1 : (x === 3) ? 2 : (x === 4) ? 7 : 1000;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #statemnt #shorthand #js
ADD COMMENT
Topic
Name
1+6 =