var x = 10; var y = 20; var result1 = x > y ? x : y; console.log(result1);
2. 顯示成年仍是未成年spa
var age = 10; var result2 = age >= 18 ? "成年了" : "未成年"; console.log(result2);