1. ES6解决了函数的默认参数的问题:
~~~
function(url, timeout = 2000, callback = function() {}) {
// do somthing
};
~~~
2. ES6默认参数不在argument对象之内;
~~~
function(first, second = 'b') {
console.log(arguments.length); // 1
console.log(first === arguments[0]); // true
console.log(second === arguments[1]) // false
};
~~~