DEV Community

Discussion on: Arrow Function is not Replacement For function(){}

Collapse
 
shyclown profile image
Roman Moravcik

I think my main point is only that you can not always use arrow function, and it should be presented as different kind of function and not replacement... and people should evaluate if its possible.

As you pointed out the arrow function does not have its own scope, prototypes... and that is why you can not use it as constructor or have "new SomeArrowFunction()".

In many cases you can not change type of function without changes to code inside function.
-> for example when using d3 library you need to use function(){}, when you need this to refer to element.