Default function parameters in ES6
Here is an example of using default function parameters in ES6:
You see that the browser displays “Hello John” because we passed in the value “John” into the sayHello function. However, because in our function definition, we had supplied a default value, we can call the function with no parameter value and the default value will be used…