箭头函数

183 阅读1分钟
  1. 箭头函数是匿名函数. 2.不能作为构造函数不能使用new
let foo=()=>{}
var newFoo=new foo()//foo is not a construcotr
  1. 箭头函数没有原型对象
  2. 不能使用argumetns,取而代之用rest参数...解决
let C = (...c) => {
  console.log(c);
}
C(1,2,3,3)