top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

In ES6, What is Default Parameter?

0 votes
416 views
In ES6, What is Default Parameter?
posted Mar 11, 2018 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

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

Example:

function multiply(a, b = 1) {
  return a * b;
}
answer Apr 30, 2018 by Chahat Sharma
...