Unit 3. Functions
Functions are a pretty fundamental construct for authoring applications. This is especially true in a language like JavaScript, which treats functions as first-class citizens. With ES2015 and later, many awesome features have been added to functions, including several completely new types of functions.
We’ll start the unit by taking a look at default parameters and rest. I think most programmers, at some point, have had the need for default parameters and likely worked around it by checking for a value and assigning one if undefined at the start of the function. The rest param is even more useful. Anyone who has used the arguments object before will be happy to use rest. Not only does rest render the arguments object obsolete, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access