JavaScript Null Checking, Undefined and ! Unary Operator

Google searches of "JavaScript null check" and "How to check for null in JavaScript" were returning results that left something to be desired in my opinion, so I compiled this list.

See the code live here: JsFiddle:
Code also available here:

Comparison Chart:

Hope this helps,

p.s. I used a great tool Regex Pixie by StoneFinch to generate most of the code in this example (disclaimer, I currently work for them, however I would never promote a tool I don't use myself.)


Popular posts from this blog

Search iPhone Text Messages with SQLite SQL Query

How to Turn Off Microsoft Arc Touch Mouse Scroll Sound Vibration

Use Azure Functions to Execute a SQL Azure Stored Procedure on a Timer