>) operator is a binary relational operator that evaluates whether its left operand is strictly greater than its right operand, returning a boolean (true or false).
- Primitive Conversion (
ToPrimitive): Both operands are converted to primitive values. If an operand is an object, JavaScript attempts to convert it by calling itsvalueOf()andtoString()methods, prioritizing numeric conversion. - String Comparison: If both resulting primitives are strings, they are compared lexicographically based on their UTF-16 code unit values.
- Numeric Conversion (
ToNumeric): If at least one of the primitives is not a string, both operands are coerced into numeric values (eitherNumberorBigInt). NaNEvaluation: If either operand coerces toNaN(Not-a-Number), the operator strictly returnsfalse.- Zero Evaluation: JavaScript treats
+0and-0as mathematically equal; neither is greater than the other.
Mechanical Examples
Strict Numeric Comparison Compares standard IEEE 754 double-precision floats or BigInts.NaN yields false.
Tired of Poor JavaScript Skills? Fix That With Deep Grasping!Learn More





