equal(): Testing Mathematical Equality
equal() returns whether values are equal. It is useful in conditional expressions, validation, and boundary checks: equal(4, 4) is true. It can compare appropriate scalar and structured values according to their mathematical representation.
Exact comparisons and decimals
Exact equality is appropriate for integers, flags, and known symbolic values. Floating-point calculations can produce tiny residues, so compare a difference with a tolerance instead: use abs(), subtract(), and smaller(). This is more reliable than expecting two separately computed decimals to match bit-for-bit.
Use deepEqual() when nested contents must match, equalText() for text-aware comparisons, and unequal() for the opposite condition. Be explicit about units and types before comparing values.