Skip to main content
The !== (strict inequality) operator evaluates whether two operands are not equal, returning a boolean result. Unlike the loose inequality operator (!=), !== does not perform implicit type coercion before comparison; it strictly evaluates both the data type and the value of the operands. It is the exact negation of the strict equality operator (===).

Evaluation Mechanics

When the JavaScript engine evaluates operand1 !== operand2, it follows a strict set of algorithmic steps:
  1. Type Comparison: If the underlying Type(operand1) is different from Type(operand2), the operator immediately returns true.
  2. Value Comparison (Same Type): If both operands share the same type, the engine evaluates their values:
    • Numbers:
      • If either operand is NaN (Not-a-Number), it returns true. By definition in IEEE 754, NaN is not equal to anything, including itself.
      • If both operands have the same numeric value, it returns false.
      • If one operand is +0 and the other is -0, it returns false (they are considered strictly equal).
    • Strings: Returns false if both strings have the exact same sequence of 16-bit code units; otherwise, it returns true.
    • Booleans: Returns false if both are true or both are false; otherwise, it returns true.
    • BigInts: Returns false if both have the same mathematical integer value; otherwise, it returns true.
    • Symbols: Returns false if both operands are the exact same unique Symbol primitive value; otherwise, it returns true.
    • Objects (including Arrays and Functions): Returns false if both operands hold a reference to the exact same object in memory. If they reference different objects—even if those objects contain identical properties or elements—it returns true.
    • Null / Undefined: null !== null and undefined !== undefined both return false.

Syntax Visualization

Tired of Poor JavaScript Skills? Fix That With Deep Grasping!Learn More