We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 143bda7 commit 7073dfaCopy full SHA for 7073dfa
1 file changed
doc/zhtw/object/prototype.md
@@ -1,5 +1,5 @@
1
## Prototype
2
-
+
3
JavaScript 不包含原本繼承的模型。然而它使用的是*原型*模型*。
4
5
然而常常有人提及 JavaScript 的缺點,就是基於原本繼承模型比類繼承更強大。
@@ -28,11 +28,11 @@ JavaScript 不包含原本繼承的模型。然而它使用的是*原型*模型*
28
// 修正 Bar.prototype.constructor 為 Bar 本身
29
Bar.prototype.constructor = Bar;
30
31
- var test = new Bar() // 開啟一個新的實例
+ var test = new Bar(); // 開啟一個新的實例
32
33
// 原型鏈
34
test [instance of Bar]
35
- Bar.prototype [instance of Foo]
+ Bar.prototype [instance of Foo]
36
{ foo: 'Hello World' }
37
Foo.prototype
38
{ method: ... }
0 commit comments