File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
1-js/08-prototypes/02-function-prototype Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ alert( rabbit.eats ); // true
5757```js
5858function Rabbit() {}
5959
60- /* default prototype
60+ /* 默认的 prototype
6161Rabbit.prototype = { constructor: Rabbit };
6262*/
6363```
@@ -68,7 +68,7 @@ Rabbit.prototype = { constructor: Rabbit };
6868
6969``` js run
7070function Rabbit () {}
71- // by default:
71+ // 默认:
7272// Rabbit.prototype = { constructor: Rabbit }
7373
7474alert ( Rabbit .prototype .constructor == Rabbit ); // true
@@ -78,10 +78,10 @@ alert( Rabbit.prototype.constructor == Rabbit ); // true
7878
7979``` js run
8080function Rabbit () {}
81- // by default:
81+ // 默认:
8282// Rabbit.prototype = { constructor: Rabbit }
8383
84- let rabbit = new Rabbit (); // inherits from {constructor: Rabbit}
84+ let rabbit = new Rabbit (); // 继承自 {constructor: Rabbit}
8585
8686alert (rabbit .constructor == Rabbit); // true (from prototype)
8787```
You can’t perform that action at this time.
0 commit comments