1if( typeof myVar === 'undefined' || myVar === null ){
2 // myVar is undefined or null
3}
1// simple check do the job
2if (myString) {
3 // comes here either myString is not null,
4 // or myString is not undefined,
5 // or myString is not '' (empty).
6}