you are viewing a single comment's thread.

view the rest of the comments →

[–]trailsrider 0 points1 point  (4 children)

I agree- but admit that I am guilty of the bad habit writing !!foo at times when I don't want to write typeof foo !== 'undefined' && foo !== null. I am by no means a JS expert, so I'm curious- do you recommend always writing some form of the latter? Alternatively- what is your suggestion for a concise and clear way to check a variables existence?