martes, abril 15, 2014

Check nullness in javascript

I have seen many code that check nullness or string empty. Like the following:

if(someVar === null || someVar === undefined || someVar === ""){ 
        //some code
}

you can have the same result like this:

if(!someVar){}

Check it working if you don’t believe me:

JS Bin