Ning Ma blog

my technology tips

using underscore to verify if a variable is undefined or null

Example of if a variable is undefined

Example of if a variable is null

function test() {
var foo = null;
console.log(_.isNull(foo)); // true,
var foo = 3;
console.log(_.isNull(foo)); // false,
}

One thought on “using underscore to verify if a variable is undefined or null

  • Kalyn says:

    Yo27#8u1&;re absolutely right on. 1) Take the time to figrue out your why otherwise you will struggle. 2) Staying motivated all the time is crucial to building and maintaining momentum. 3) With so much noise out there it can be tough to stay focused, but stay focused you must. 4) Connecting with successful MLMers is what will help you maintain #2 & #3. Great article!

Leave a Reply

Your email address will not be published. Required fields are marked *

*