We all realize the pervasive use of functions in JavaScript. Consequently, defining functions and laying out function signatures is one thing we do a lot. Default parameters, a new feature introduced in ES6, provide us the power to improve how we detail our function signatures. They allow us to specify what the value of a parameter to a function ought to be if no value is passed in at invocation time. Along the same vein, rest parameters allow us to express that a function (or method) has no expectation to the number of arguments you can supply it—in other words, ...
Get JavaScript Next: Your Complete Guide to the New Features Introduced in JavaScript, Starting from ES6 to ES9 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.