📅  最后修改于: 2022-03-11 14:56:33.735000             🧑  作者: Mango
//
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}.\nThe tip is ${tip}.\nIN TOTAL: ${bill + tip}.`);