Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9473c46

Browse files
🐛 fix: 修复了部分代码块缺失代码高量
1 parent e7190fa commit 9473c46

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

‎Prototype/Prototype.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ prototype 的几种方法
3232

3333
#### 1.Object.create()方法
3434

35-
```
35+
```javascript
3636
let proto = {a:1}
3737
let propertiesObject = {
3838
b: {
@@ -48,7 +48,7 @@ console.log(obj.__proto__ === proto); // true
4848

4949
#### 2.方法继承
5050

51-
```
51+
```javascript
5252
// 方法继承
5353
let proto = function() {}
5454
proto.prototype.excute = function() {}
@@ -60,14 +60,14 @@ child.prototype = new proto()
6060

6161
#### 3.函数对Object的默认继承
6262

63-
```
63+
```javascript
6464
let Foo = function() {}
6565
console.log(Foo.prototype.__proto__ === Object.prototype); // true
6666
```
6767

6868
#### 4.isPrototypeOf
6969

70-
```
70+
```javascript
7171
prototypeObj.isPrototypeOf(obj)
7272
```
7373

@@ -77,23 +77,23 @@ prototypeObj.isPrototypeOf(obj)
7777

7878
contructor.prototype是否出现在obj的原型链上
7979

80-
```
80+
```javascript
8181
obj instanceof contructor
8282
```
8383

8484
#### 6.getPrototypeOf
8585

8686
Object.getPrototypeOf(obj) 方法返回指定对象obj的原型(内部[[Prototype]]属性的值)
8787

88-
```
88+
```javascript
8989
Object.getPrototypeOf(obj)
9090
```
9191

9292
#### 7.setPrototypeOf
9393

9494
设置一个指定的对象的原型 ( 即, 内部[[Prototype]]属性)到另一个对象或 null
9595

96-
```
96+
```javascript
9797
var obj = {}
9898
var prototypeObj = {}
9999
Object.setPrototypeOf(obj, prototypeObj)

‎docs/Factory.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
通过一个工厂创建一种对象类的实力。主要用来创建同一类的对象。
1212

13-
```
13+
```javascript
1414
// 简单工厂模式
1515
// Pet 类
1616
class Pet {
@@ -49,7 +49,7 @@ console.log(Abird.sound); // chirping
4949

5050
工厂方法模式让我们将创建实例的过程推迟到了*子类*中,这样我们的核心类就变成的抽象类,并且将构造函数和创建者分离,对 new 操作进行了封装。
5151

52-
```
52+
```javascript
5353
// 工厂方法模式
5454
class Pet {
5555
constructor(species = '', sound = '') {

‎docs/Itrerator copy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
其实我们无形中已经使用了不少迭代器模式的功能,例如 JS 中数组的 `map`, 与 `forEach`已经内置了迭代器。
66

7-
```
7+
```javascript
88
[1,2,3].forEach(function(item, index, arr) {
99
console.log(item, index, arr);
1010
});

‎docs/Itrerator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
其实我们无形中已经使用了不少迭代器模式的功能,例如 JS 中数组的 `map`, 与 `forEach`已经内置了迭代器。
66

7-
```
7+
```javascript
88
[1,2,3].forEach(function(item, index, arr) {
99
console.log(item, index, arr);
1010
});

‎docs/Prototype.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ console.log(obj.__proto__ === proto); // true
4848

4949
#### 2.方法继承
5050

51-
```
51+
```javascript
5252
// 方法继承
5353
let proto = function() {}
5454
proto.prototype.excute = function() {}
@@ -60,14 +60,14 @@ child.prototype = new proto()
6060

6161
#### 3.函数对Object的默认继承
6262

63-
```
63+
```javascript
6464
let Foo = function() {}
6565
console.log(Foo.prototype.__proto__ === Object.prototype); // true
6666
```
6767

6868
#### 4.isPrototypeOf
6969

70-
```
70+
```javascript
7171
prototypeObj.isPrototypeOf(obj)
7272
```
7373

@@ -77,23 +77,23 @@ prototypeObj.isPrototypeOf(obj)
7777

7878
contructor.prototype是否出现在obj的原型链上
7979

80-
```
80+
```javascript
8181
obj instanceof contructor
8282
```
8383

8484
#### 6.getPrototypeOf
8585

8686
Object.getPrototypeOf(obj) 方法返回指定对象obj的原型(内部[[Prototype]]属性的值)
8787

88-
```
88+
```javascript
8989
Object.getPrototypeOf(obj)
9090
```
9191

9292
#### 7.setPrototypeOf
9393

9494
设置一个指定的对象的原型 ( 即, 内部[[Prototype]]属性)到另一个对象或 null
9595

96-
```
96+
```javascript
9797
var obj = {}
9898
var prototypeObj = {}
9999
Object.setPrototypeOf(obj, prototypeObj)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /