Why is there no logical xor in JavaScript?

前端 未结 19 2123
忘了有多久
忘了有多久 2020-11-29 17:17

Why is there no logical xor in JavaScript?

19条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-29 17:26

    The reason there is no logical XOR (^^) is because unlike && and || it does not give any lazy-logic advantage. That is the state of both expressions on the right and left have to be evaluated.

提交回复
热议问题