TA贡献1824条经验 获得超6个赞
"con1" || "con2": "con1"是个字符串,相当于true,所以"con1" || "con2" == "con1"if(condition == "con1" || "con2")你只是判断了condition == "con1"
TA贡献1765条经验 获得超5个赞
不能,优先级问题相当于
if((condition == "con1") || ("con2"))
数据结构与算法(前端版)
¥ 58.00
Web前端开发修炼指南
解锁前端面试体系核心攻略
¥ 78.00
高薪之路—前端面试精选集
JavaScript 设计模式精讲
¥ 48.00
举报