lundi 7 décembre 2015

null escaped in nodejs

I console.log("var = " + JSON.stringify(result.something));

I got var = null

but when I do

if(result.something !=null || result.something != ''){
console.log('enter')
}

it print enter also. I wonder why is that happening, I also tried result.something != 'null', it still go into the if statement.

Aucun commentaire:

Enregistrer un commentaire