Skip to content

Commit 876a7b4

Browse files
committed
docs: fix function/参数默认值
1 parent eb2a622 commit 876a7b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/function.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function foo(x, x, y = 1) {
7373
// SyntaxError: Duplicate parameter name not allowed in this context
7474
```
7575

76-
另外,一个容易忽略的地方是,如果参数默认值是变量,那么参数就不是传值的,而是每次都重新计算默认值表达式的值。
76+
另外,一个容易忽略的地方是,如果参数默认值是变量,那么参数就不是传值的,而是每次都重新计算默认值表达式的值。也就是说,参数默认值是惰性求值的。
7777

7878
```javascript
7979
let x = 99;

0 commit comments

Comments
 (0)