Ya Chuyachuh.hashnode.dev·Sep 19, 2023JavaScript - Null, undefined, not defined 差異Null, undefined, not defined 差異 null 與 undefined 差異 null 代表「空值」(有被賦予為空的值),轉為數值時為 0;undefined 代表「未定義」的原始值(尚未被賦予值),轉為數值時為 NaN undefined 與 not defined 差異 undefined 是變數被宣告了但沒有賦值,屬於原始型別之一;not defined 是變數沒有被宣告,不屬於原始型別,是執行程式時的錯誤訊息 (runtime error),需要被修正。 con...30 readsJavaScriptJavaScriptAdd a thoughtful commentNo comments yetBe the first to start the conversation.