Arrow functions
suggest changeArrow functions automatically bind to the ‘this’ lexical scope of the surrounding code.
performSomething(result => {
this.someVariable = result
})
vs
performSomething(function(result) {
this.someVariable = result
}.bind(this))
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents