Somehow, JavaScript makes sense of the bitwise operations NaN ^ 1
, Infinity ^ 1
and even 'a' ^ 1
(all evaluate to 1
).
What are the rules governing bitwise operators on non numbers? Why do all the examples above evaluate to 1
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…