区别
- 箭头函数体内的this对象,就是定义时所在的对象,而不是使用时所在的对象。
- 箭头函数没有arguments,如果要用,可以用 rest 参数代替 (注意在node环境下是有arguments的)
- 箭头函数不能作为构造函数,不能使用new
- 箭头函数没有原型,不能继承
- 箭头函数不能当做Generator函数,不能使用yield关键字
验证示例
  <script>
      const test1=(...numbers)=>{
          console.log(this)
          console.log(numbers)      
          console.log(arguments)
      };
      const test2=function(){
          console.log(this)
          console.log(arguments)
      }
      test1(123);//分别输出 window [123] 报错
      test2(123);//分别输出 window Arguments 
  </script>
const test1=(...numbers)=>{
  console.log(this)
  console.log(numbers)      
  console.log(arguments)
};
const test2=function(){
  console.log(this)
  console.log(arguments)
}
test1(123);//分别输出 global [123] Arguments
test2(123);//分别输出 global Arguments 
参考