Arrow function is easy way to create a function in ES6, which doesn’t create its own this reference. It always pointed this context from where it is created or called.

About Arrow Function:

  1. It doesn’t has its own binding to this,arguments or super and should not be used as method,
  2. It is not suitable for call, apply and bind method which is generally rely on establishing a scope,
  3. Cannot be used as Constructor,
  4. Cannot use Yield method within its body,
  5. Doesn’t have access to new.target keyword.
  6. It doesn’t have Prototype property.

New Operator:

const test = (x,y) => x + y;
const result = new test();
const People = {
name: 'angularfeed',
getName: () => {
return this.name;
}
}
const result = People.getName();
console.log(result); // throw undefined

Prototype Property:

const Test = (x) => x;
const result = Test.prototype.name = 'angularfeed'; // undefined

Yield method:

call, apply and bind:

Object Literals:

const Test = () => ({name: 'angularfeed'})

Syntax:

const Example = () => {} // returns undefined(() => 'Hello World')() // return Hello Worldconst list = ['India', 'USA', 'Ireland'];
list.map((item, index) => {
return `${item} has index ${index}`;
})
  1. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions