1. The arrow function is anonymous and cannot be used as a constructor. Ordinary functions can be used to construct functions and create objects.

2. The arrow function has no arguments. Argument is a keyword in JavaScript that points to all arguments passed by the caller. In the arrow function, if you want to get all the parameters passed in, you need to use the REST parameter (… Variable name)

const a = (... B) =>{console.log(b)} a(1,2,3)Copy the code

3. The scope of this is different. In normal functions, this refers to the object calling it. If used as a constructor, this refers to the object instance being created. The arrow function itself does not have a this value; it uses this from the function scope chain.

const a = {
    b:10,
    c:() => {
        console.log(this.b)
    },
    d:function(){
        console.log(this.b)
    }
}
a.c() // undefined
a.d() // 10
Copy the code

4. Arrow functions have no stereotype properties

const a = () => {}
console.log(a.prototype);  // undefined
Copy the code

5. Arrow functions cannot be used as Generator functions. Yield keyword cannot be used