Why you should care
“Is not equal to” is utilized to ensure that the values are not identical to each other. Without a comparison operator, values cannot be compared.
It is recommended to avoid implied typecasting as it causes confusion on the technical side. This results in allowing more risks in the code and leading to lack of productivity.
How we detect
To avoid confusion caused by the implied typecasting, always use the === and !== operators that check both the values and the type of the expressions you compare, because the understanding of what is a falsy value may be confusing.
The == and != operators do type coercion. In particular, do not use == to compare against false values.
About CAST and Highlight’s Code Insights
Over the last 25 years, CAST has leveraged unique knowledge on software quality measurement by analyzing thousands of applications and billions of lines of code. Based on this experience and community standards on programming best practices, Highlight implements hundreds of code insights across 15+ technologies to calculate health factors of a software.