feature(guide): added usage of default parameters (#19087)
When the default parameters are not in the end of the parameters list, they still can be used if you pass 'undefined' arguments.
This commit is contained in:
committed by
Quincy Larson
parent
8d8b7843b6
commit
3fda823973
@ -47,3 +47,9 @@ NotWorkingFunction(20, 30); // 50;
|
||||
```
|
||||
|
||||
Works fine.
|
||||
|
||||
However, if you want to use the default first parameter, you can pass `undefined` as the first argument of the function call.
|
||||
|
||||
```
|
||||
NotWorkingFunction(undefined, 30); // 40;
|
||||
```
|
||||
|
Reference in New Issue
Block a user