📜  javascript代码示例中的逻辑运算符

📅  最后修改于: 2022-03-11 15:04:06.508000             🧑  作者: Mango

代码示例5
n1 = !true               // !t returns false (the opposite of true)
n2 = !false              // !f returns true (the opposite of false)
n3 = !''                 // !f returns true (in JavaScript, an empty string is falsey, thus the opposite of a falsey value here is truthy.)
n4 = !'Cat'              // !t returns false (non empty string is truthy, thus opposite is falsy)