When to Use === and ==
Use the == operator only when checking for null or undefined. In all other cases, use === for strict equality.
For example:
1 | if(obj.a == null){} |
is equivalent to:
1 | if (obj.a === null || obj.a === undefined) {} |
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.