© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
slikts
Just checking for truthiness when you specifically mean null or undefined is an antipattern since it leads to accidentally mishandling values like 0 or empty strings. You should use == null in this case instead.
null
undefined
== null
Alex Ershov
Thanks for suggestion slikts! Just corrected the answer!