Strict equality should not be used for two values with different types
- No tags
This rule applies when two values with different types are compared with strict equality.
Strict equality is always
false for different types, so this comparison is not likely to be a programmer's intent.
Noncompliant Code Example
var x = 10 / 3; x.toFixed(1) === 3.3; // COMPARE_INCOMPATIBLE_TYPE_STRICTLY alarm because 'toFixed' function returns string type.
Compliant Code Example
var x = 10 / 3; x.toFixed(1) === "3.3";
This rule was introduced in DeepScan 1.0.0-alpha.