Context:
I often see in javascript programs the following conditional statement:
if (myVariable){
....
}
As I understand do fat it tests against both undefined and null but I an not sure what else, I suppose against boolean false...
Theoretically if I want to write the exact negation I can wrote
if (myVariable){
// dummy empty
}
else{
// My conditional code here
}
Question
What is the exact equivalent of the code above in the following simplest form?
if (<what to write here using myVariable>){
// My conditional code here
}
The answer if (!myVariable)
seems too obvious, and I am not sure there are no traps here regarding undefined, null behaviours...