3. 函数参数默认值

ES6 中允许你对函数参数设置默认值:

  1. let getFinalPrice = (price, tax=0.7) => price + price * tax;
  2. getFinalPrice(500); // 850