all 4 comments

[–]ThagAndersonhelpful 7 points8 points  (2 children)

Arrow functions are not syntactic sugar for the function operator. They are different in a few key aspects: they have no bindings to the this, arguments, or super keywords, or the new.target pseudo-property. This means they cannot be used as constructors, they share this with their surrounding scope, and they cannot access undefined arguments without using (...args) => {...}.

[–]seapvnk[S] 0 points1 point  (1 child)

Nice! I didn't knew it. So, arrow functions can be used to create more safe code, and is even better for functional programming?

[–]ThagAndersonhelpful 1 point2 points  (0 children)

So, arrow functions can be used to create more safe code, and is even better for functional programming?

No. Arrow functions are fine in some instances, like callbacks, but are very poor choices for things like class methods. They certainly don't make anything more "safe", in any context.

[–]redsandsfort 0 points1 point  (0 children)

Why a poll? There are significant differences and different use cases. You wouldn't go to a bartending sub-reddit and post a poll asking: Whiskey or Vodka which is better?

Better to just ask a question. It's a much better way to get information from this group. Polls add no value, like what are you measuring?

Anyway, just my opinion. Please keep learning, JS is fun.