📜  expresiones ternarias javascript 代码示例

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

代码示例1
var condition = false;
var result1 = "First result";
var result2 = "Second result";
var result = condition ? result1 : result2;
//result1 will be assigned to result if condition is true.
//If not, result2 will be assigned