Skip to content

Commit 1feca97

Browse files
committed
Merge pull request ruanyf#3 from likev/gh-pages
Update function.md
2 parents 623deb8 + 8e077e4 commit 1feca97

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

docs/class.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ ES6引入了Class(类)这个概念,可以定义class,作为对象的模
66

77
```javascript
88

9+
//定义类
910
class Point {
1011

1112
constructor(x, y) {
@@ -19,6 +20,10 @@ class Point {
1920

2021
}
2122

23+
//使用类
24+
var point = new Point(2,3);
25+
point.toString(); //(2, 3)
26+
2227
```
2328

2429
上面代码定义了一个class类,可以看到里面有一个constructor函数,这就是构造函数。而this关键字则代表实例对象。

docs/function.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ push(a, "a1", "a2", "a3", "a4");
7575

7676
```
7777

78-
注意,rest参数不能再有其他参数,否则会报错。
78+
注意,rest参数之后不能再有其他参数,否则会报错。
7979

8080
```javascript
8181

0 commit comments

Comments
 (0)