上代碼:function A(){ this.name = "Aiello"; this.id = 123; this.destroy = function(){ /* Todo */ }}// 創(chuàng)建實(shí)例var a = new A();// 輸出屬性console.log(a.name); // 'Aiello'// 刪除對(duì)象自身a.destory();console.log(a); // 這里可以是返回 null 或 undefind 或者 報(bào)錯(cuò)這種功能能實(shí)現(xiàn)嗎?
Javascript 對(duì)象如何刪除自身?
慕田峪4524236
2018-09-10 12:31:20