ECMAScript 2015 (ES6) Arrow functions – Quick reference

Arrow functions

An arrow function expression has a shorter syntax => compared to function expressions.

Arrow functions are always anonymous (Functions declared dynamically at runtime called Anonymous functions. Anonymous functions don’t have a name and not hoisted). The examples are below

Function without any parameters

Function with 1 parameter

Function with more than 2 parameters

this reference

An arrow function does not create its own this context, so this has the original meaning from the enclosing context.

Leave a Reply

Your email address will not be published. Required fields are marked *