You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since arrow function has a short syntax, it's inviting to use it for a method definition.
You can't use an arrow function when a dynamic context is required: defining methods,
create objects with constructors, get the target from this when handling events.
Since arrow function has a short syntax, it's inviting to use it for a method definition.
You can't use an arrow function when a dynamic context is required: defining methods,
create objects with constructors, get the target from this when handling events.
Defining methods on an object
Object literal
👍
Object prototype
Callback functions with dynamic context
Invoking constructors
Too short syntax
To make it more readable, it is possible to restore the optional curly braces and
return statement from the arrow function or use a regular function
👉 https://rainsoft.io/when-not-to-use-arrow-functions-in-javascript/
The text was updated successfully, but these errors were encountered: