Hacker News new | ask | show | jobs
by dntrkv 2516 days ago
Arrow functions aren't just new syntax, they keep the context in which they are declared.

It allows devs to do the following:

onClick={() => doSomething()}

Without having to worry about binding the function to the correct context.