分享至
想請問 為什麼指向一個object不存在的屬性 它會回傳undefined 而不是 not defined呢?
var obj = { "name" : "thomas" , "age" : 18} obj.weight // undefined
已邀請的邦友 {{ invite_list.length }}/5
你要明白 undefined 和 "x" is not defined 的区别。Undefined https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/undefined"x" is not defined https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Errors/Not_defined
IT邦幫忙