## A different way of understanding `this` in JavaScript

A different way of understanding `this` in JavaScript

51 27 19 1 116

details
Share on
Facebook,
Twitter or
Google+

In this blog post, I take a different approach to explaining `this`

in JavaScript: I pretend that arrow functions are the real functions and ordinary functions a special construct for methods. I think it makes `this`

easier to understand – give it a try.

In this post, we focus on two different kinds of functions:

- Ordinary functions:
`function () {}`

- Arrow functions:
`() => {}`

An ordinary function is created as follows.

`function add(x, y) { return x + y; } `

Each ordinary function has the implicit parameter `this`

that is always filled in when it is called. In other words, the following two expressions are equivalent (in strict mode).

*... read the whole story at 2ality.com.*