undefined 不一樣 not defined 是 JavaScript 錯誤 var a; alert(a); // undefined var b = null; alert(b); // null b = undefined; alert(b); // undefined alert(c); // ReferenceError: c is not defined
not defined var o = new Object(); alert(o.p); // undefined o.p = 1; alert(o.p); // 1 delete o.p; alert(o.p); // undefined alert(a); // ReferenceError: c is not defined