📜  三元运算符是如何工作的? - Javascript代码示例

📅  最后修改于: 2022-03-11 15:01:32.012000             🧑  作者: Mango

代码示例1
let moneyAmount = 80;
let creditCardAmont = 70;

let drink = (moneyAmount > 60 && creditCardAmont > 50) ? 'buy coke' : 'filter water';
console.log(drink)