I understand that in JavaScript you can write:
if (A && B) { do something }
But how do I implement an OR such as:
if (A OR B) { do something }
Simply use the logical "OR" operator, that is ||.
||
if (A || B)
2.1m questions
2.1m answers
60 comments
57.0k users