I understand that in JavaScript you can write:(我知道在JavaScript中你可以写:)
if (A && B) { do something }
But how do I implement an OR such as:(但是我如何实现OR,例如:)
if (A OR B) { do something }
Simply use doublepipe operator that is ||(只需使用|| doublepipe运算符即可)
||
if (A || B)
2.1m questions
2.1m answers
60 comments
57.0k users