Are Null, Undefined and false are same in data types in javascript ?
if(null){
//This code won't work
}
if(false){
//This code won't work
}
if(undefined){
//This code won't work
}
are they same theoretically ?
Internally, JavaScript sets a value to one of six primitive data types:
Here are the complete list of JavaScript falsy values

nullis an Object.falseis a Boolean.undefinedis of typeundefined. But they have in common the fact that they are all falsy values. Which means that when they are converted to Booleans (implicitely or explicitely), they translate tofalse, which is why none of yourifconditions pass. The same would happen to0, or an empty String""