The ES6 way
default values and using a variable number of arguments in functions
We'll cover the following...
We'll cover the following...
ES6 supports default values. Whenever an argument is not given, the default value is substituted. The syntax is quite compact:
Suppose function f is given with two arguments, a and b. ...