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 a JS Bin with the examples.

More posts