Logical NOT operator is represented by the exclamatory (
!) symbol. It is a unary operator.
The ! operator is written before an operand. It returns
true if an operand evaluates to falsy. If an operand is truthy then it returns
false. In simple terms, it returns
NaN, 0, and "" are falsy values. You can verify this by applying the logical NOT operator twice.
console.log(!!null); //false console.log(!!undefined); //false console.log(!!NaN); //false console.log(!!0); //false console.log(!!""); //false