jeudi 29 janvier 2015

Javascript Difference Between x=10; if(x) and if(x===10)

I understand that in terms of boolean


x = true; if(x) //This is the same as if(x === True) doSomething();


But if one were to set x to a number, then what does the if condition mean? Does the condition mean if(x === true)? If so, why is that?


Aucun commentaire:

Enregistrer un commentaire