Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR R

javascript if else

/* Shorten if-else by ternary operator*/
const go = "yes"
let race = null

race = go === "yes" ? 'Green Light' : 'Red Light';
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript
ADD COMMENT
Topic
Name
5+9 =