ES6 Essentials 05: Default Parameters & The Rest Operator

preview_player
Показать описание
In this tutorial, you'll learn about a couple of new features for handling parameters / arguments in ES6; default values and the rest operator.

We'll go through the explanation of default parameters and the rest operator with an example function that shows how an undefined value on one particular parameter can cause a JavaScript function to behave unexpectedly.

Default parameters in JavaScript allow us to set a value to a parameter if one is not supplied in the call to the function. I'll also show you how you can catch unexpected undefined values that are passed to your functions.

In the second part of the tutorial, i'll talk you through how you can make use of the JavaScript rest operator to deal with a variable number of values passed to your functions.

#JavaScript #ES6 #ES6Essentials Channel Handle @codebubb
Рекомендации по теме