// 标准 var isYes = answer === 1 ? true : false; // 优化 var isYes = answer === 1; // 标准 var isNo = answer === 1 ? false : true; // 优化 var isNo = answer !== 1; 来源:CSDN作者:北风很冷链接:https://blog.csdn.net/qiaoguoqing/article/details/103733714 标签 三元