console.log(null === undefined) // false (not the same type)console.log(null == undefined) // true (but the "same value")console.log(null === null) // true (both type and value are the same)
let supervisor = "None"// I have a supervisor named "None"
let supervisor = null// I do NOT have a supervisor. It is a FACT that I do not.
let supervisor = undefined// I may or may not have a supervisor. I either don't know// if I do or not, or I am choosing not to tell you. It is// irrelevant or none of your business.
null and undefined thankfully have different types. null belongs to the type Null and undefined to the type Undefined. This is in the spec, but you would never know this because of the typeof weirdness which I will not repeat here.
A function reaching the end of its body without an explicit return statement returns undefined since you don't know anything about what it returned.
By the way, there are other forms of "nothingness" in JavaScript (it's good to have studied Philosophy....)
NaN
Using a variable that has never been declared and receiving a ReferenceError
Using a let or const defined local variable in its temporal dead zone and receiving a ReferenceError
Empty cells in sparse arrays. Yes these are not even undefined although they compare === to undefined.