The fundamental difference between undefined and null is that, in JavaScript, undefined means a variable has been declared (or not declared), but has not yet been assigned a value. On the other hand, null is an assignment value. It can be assigned to a variable as a representation of no value.
簡單來說,undefined是變量被聲明但未被賦初始值的狀態(tài);null是有初始值,初始值為空的狀態(tài)。