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:
Budavölgyi Bálint
2018-10-16 05:32:46 +02:00
committed by Quincy Larson
parent 8d8b7843b6
commit 3fda823973

View File

@ -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;
```