Re: [問題] 關於Javascript的prototype問題

看板Ajax作者 (冒牌費大公)時間17年前 (2008/08/28 16:41), 編輯推噓2(200)
留言2則, 2人參與, 最新討論串2/2 (看更多)
說哪個最先有,可能會混淆焦點。看一下ECMA-262 Edition3文件: 關於Object,他說明: 15.2.4 Properties of the Object Prototype Object The value of the internal [[Prototype]] property of the Object prototype object is null and the value of the internal [[Class]] property is "Object". 關於Function,他說明: 15.3.4 Properties of the Function Prototype Object The Function prototype object is itself a Function object (its [[Class]] is "Function") that, when invoked, accepts any arguments and returns undefined. The value of the internal [[Prototype]] property of the Function prototype object is the Object prototype object (section 15.3.2.1). 從他的規定,基本上可以看作Function繼承Object。 Javascript內部實作,可能不會管誰繼承誰,只是依照ECMA-262 Edition3的標準,把 該給什麼值的地方給什麼值而已。所以不要煩惱Native ECMAScript Objects這方面的 問題啦。 -- Sapere Aude! 這就是啟蒙運動的口號! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 60.250.95.16

08/28 17:45, , 1F
喔喔喔喔又現身了!娘子快來看高手!!(拜倒)
08/28 17:45, 1F

08/30 02:31, , 2F
哇賽~fillano高手~(拜倒)
08/30 02:31, 2F
文章代碼(AID): #18jcJLCl (Ajax)
文章代碼(AID): #18jcJLCl (Ajax)