Dieses Blog durchsuchen

Montag, 22. August 2016

ES6: prevent that = this;

Some days ago I found a solution for following problem in Javascript:

Solve a really ugly problem

I know many lines of code where you find follwing that-this reference
Now with ES6 you can solve this problem with the arrow function like this.

As you can see, you can directly use this in the arrow-function, which is a kind of a shortcut to "function". Thats really nice.

Keine Kommentare:

Kommentar veröffentlichen