Way of a road covered with snow around

ES6: arrow functions in 5 minutes

The arrow functions at first might seem confusing (for me (◕(◕) ), but after a while, you can understand their shorter syntax and the magic of the scope of this.

Multiple parameters

Without arrow functions.

With arrow functions.

Or in a shorter way.

Only one parameter

Without arrow functions.

With arrow functions.

Scope

Without arrow functions.

With arrow functions.

Example with map

Without arrow functions.

With arrow functions.

Here you can find an JS Bin with the examples.

See all posts...