Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js.l16

//	
var age = 26;
var beverage = (age >= 21) ? "Beer" : "Juice";
console.log(beverage);

EXAMPLE:

//
const bill = 270;
const tip = bill >= 50 && bill <= 300 ? bill * 0.15 : bill * 0.2;
console.log(`The bill is: ${bill}.
The tip is ${tip}.
IN TOTAL: ${bill + tip}.`);
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
8+2 =