JavaScript:逻辑运算符“A && B”的反义词是什么?

JavaScript: What is the opposite of the logical operator `A && B`?

在下面的代码中,条件 (ran1 <= 63 && ran2 <= 18) 的反义词是什么,它应该适合 if 语句的 else 部分?

(ran1 <= 63 || ran2 <= 18)(! (ran1 <= 63 && ran2 <= 18))吗?

从逻辑上讲,我认为 A and B 的反义词是 A or Bneither A nor B。但是我不确定如何在 JavaScript.

中表达 neither A nor B
var ran1 = 1 + Math.floor(Math.random() * 100);
var ran2 = 1 + Math.floor(Math.random() * 100);

if (ran1 <= 63 && ran2 <= 18) {
    // code
} else {
    // code
}

A && B 的数学否定是 !A || !B,所以在你的情况下,它将是

ran1 > 63 || ran2 > 18