default argument in function javascript code example
Example 1: javascript default parameters
function multiply(a, b = 1) {
return a * b;
}
Example 2: js unspecified parameters
function my_log(...args) {
// args is an Array
console.log(args);
// You can pass this array as parameters to another function
console.log(...args);
}