Skip to content

Commit 344f5e2

Browse files
committed
fix: 箭头函数由多个括号组成,应使用更严谨的括号描述进行区分
1 parent 9383fc8 commit 344f5e2

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)