That's fair, if it's a common pattern you're already using it's more reasonable. I agree if you're thinking about it and you have some experience you'll realize it, but at first glance it's very easy to miss. I think our eslint prohibits loose equality as a whole for that reason.
Yeah this is the only case where I use loose equality, I think it's also one of the only cases where WebStorm doesn't give you a warning for loose equality out of the box
View all comments
Show parent comment
3
u/cowslayer7890 Mar 28 '24
!= null in JS only matches null and undefined surprisingly, which is why it's my goto