ECMAScript 2015 (ES6) Default parameters – Quick reference

Default parameters

Default function parameters allow formal parameters to be initialized with default values if no value or undefined is passed.

The above default parameter code is equivalent to the following code.

Leave a Reply

Your email address will not be published. Required fields are marked *