看板 [ Ajax ]
討論串[問題][js] closure 和 prototype的差別~
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓3(3推 0噓 8→)留言11則,0人參與, 最新作者fillano (冒牌費大公)時間16年前 (2009/06/03 17:11), 編輯資訊
0
0
1
內容預覽:
closure簡單說就是function defined in function. 用不用closure對於用this指定的property是沒差,但是對於區域變數就會有差別:. function test() {. var x=2;. var y=3;. this.getTest = functi
(還有877個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者kevintwo (MAI舞)時間16年前 (2009/06/02 22:59), 編輯資訊
0
0
1
內容預覽:
(問題一). 在這個網頁==>. http://caterpillar.onlyfun.net/Gossip/AjaxGossip/ConstructorPrototype.html. 裡提到的 getSize 的建立方式分別為closure 和 prototype的方式. 請問差別在哪呢? 不知怎
(還有377個字)
首頁
上一頁
1
下一頁
尾頁