The primary use of an arrow function is to bind the context so that "this" becomes lexical and not determined at run time. This is super helpful when writing React!
Though I will admit that arrow functions are quite snazzy looking and using it just because it looks better is totally valid.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
An arrow function is, basically, a replacement for the
function
keyword. There is a bit more nuance to it but that's the basic rule.If you weren't using
function
before you don't need to use it now.The primary use of an arrow function is to bind the context so that "this" becomes lexical and not determined at run time. This is super helpful when writing React!
Though I will admit that arrow functions are quite snazzy looking and using it just because it looks better is totally valid.