main.js
1
2
3
4
5
6
7
8
9
function multiply(a, b) {
  if (b === undefined) {
    b = 2;
  }
  console.log(a); // => 5
  console.log(b); // => 2
  return a * b;
}
console.log(multiply(5)); // => 10
Native Browser JavaScript