三元运算符的结果语句可以执行多个操作,每个操作用逗号分隔就可以,例子如下: var a=1; a>5?(alert(1),alert(2)):(alert(3),alert(4)) 转载于:https://www.cnblogs.com/xujiucheng/p/7359803.html