Skip to content

Commit

Permalink
docs(function): fixed typo
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanyf committed Apr 10, 2024
1 parent d5e0f47 commit 57cdc82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/function.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ function f(x = 456) {
return x;
}

f2(undefined) // 456
f(undefined) // 456
```

具有默认值的参数如果不位于参数列表的末尾,调用时不能省略,如果要触发默认值,必须显式传入`undefined`
Expand Down

2 comments on commit 57cdc82

@kylesaid
Copy link

@kylesaid kylesaid commented on 57cdc82 May 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里修复了,但未同步到教程 https://typescript.p6p.net/typescript-tutorial/function.html ,显示还是f2;

@ruanyf
Copy link
Contributor Author

@ruanyf ruanyf commented on 57cdc82 May 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

那是网友搭建的,无法随着源码更新,请参考官方网站 https://wangdoc.com/typescript/function

Please sign in to comment.