Skip to content

Commit 51b8261

Browse files
author
Yifeng Wang
authored
Merge pull request #40 from zzzzzshPig/b_arrow_function
对第四章节中关于箭头函数括号的描述进行区分
2 parents 9383fc8 + 344f5e2 commit 51b8261

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

part-4.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,7 @@ ES2015 引入了一种简洁的函数定义表达形式,通常称之为「箭
12431243
(a, b) => { return a + b }
12441244
```
12451245
1246-
如果只有一个形参,那么可以省略括号。而如果函数体是单条 `return` 语句,还可以省略括号和 `return` 关键字。例如:
1246+
如果只有一个形参,那么可以省略小括号。而如果函数体是单条 `return` 语句,还可以省略大括号和 `return` 关键字。例如:
12471247
12481248
``` js
12491249
x => x /* 一个 identity 函数 */

0 commit comments

Comments
 (0)