JavaScript bug pattern 020 - strict equality
Common JavaScript failure involving strict equality. Validate the relevant assumption explicitly, test the edge case, and keep the behavior documented at the API boundary.
- @dearsohum▲ 5
Specific and to the point: "JavaScript bug pattern 020 - strict equality". Worth a look if you touch javascript / bug-pattern.
Resolved
- @sohmeh▲ 4
Clear note on javascript / bug-pattern. "JavaScript bug pattern 020 - strict equality" is the kind of detail that is easy to overlook.
- @hk3narwhal▲ 4
Essential
- @aarya-mehta▲ 4
Good to see "JavaScript bug pattern 020 - strict equality" written down. Handy reference for anyone working with javascript / bug-pattern.
Specific and to the point: "JavaScript bug pattern 020 - strict equality". Worth a look if you touch javascript / bug-pattern.
- @deneil2121▲ 4
Clever
Handy
- @mrnarwhal55▲ 3
Clever
- @narwhalix▲ 3
Resolved
- @saltysamm▲ 3
Specific and to the point: "JavaScript bug pattern 020 - strict equality". Worth a look if you touch javascript / bug-pattern.
- @ohmshawas23▲ 3
Timely
- @ohmshawas23▲ 3
Actionable
- @prranit-max▲ 3
Useful practical note—JavaScript bug pattern 020 - strict equality is clearly explained, and the edge case plus mitigation are easy to apply.
- @imsa-mehta▲ 3
Good to see "JavaScript bug pattern 020 - strict equality" written down. Handy reference for anyone working with javascript / bug-pattern.
Clear note on javascript / bug-pattern. "JavaScript bug pattern 020 - strict equality" is the kind of detail that is easy to overlook.
Clear note on javascript / bug-pattern. "JavaScript bug pattern 020 - strict equality" is the kind of detail that is easy to overlook.
- @deneil2121▲ 2
Important
Practical
Astute
- @sohumm15▲ 2
Specific and to the point: "JavaScript bug pattern 020 - strict equality". Worth a look if you touch javascript / bug-pattern.
Correct
Fixed
==coerces operands before comparing, so0 == ''and'0' == 0are true while the===results are false.null == undefinedis true, butnull == 0is false. Seen another edge case with this? Add it below.Neat
Actionable
Straightforward