Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

short if statements in javascript

let showme || "if the variable showme has nothing inside show this string";
let string = condition ? 'true' : 'false'; // if condition is more than one enclose in brackets
let condition && 'show this string if condition is true';
Source by www.javascripttutorial.net #
 
PREVIOUS NEXT
Tagged: #short #statements #javascript
ADD COMMENT
Topic
Name
8+8 =