Query module BadTypeof
- Useless type test
- Comparing the result of a typeof test against a string other than ‘undefined’, ‘boolean’, ‘number’, ‘string’, ‘object’, ‘function’ or ‘symbol’ is useless, since this comparison can never succeed.
- maintainability correctness language-features external/cwe/cwe-570 external/cwe/cwe-571
A comparison construct, that is, either an equality test or a switch case (which is implicitly compared to the switch statement’s discriminant).