DEV Community

Discussion on: Arrow Function vs Function

Collapse
sshymko profile image
Sergii Shymko Author • Edited

Thanks for a very detailed constructive feedback! Much appreciated!

Indeed, coming from PHP, I've used the term "closure" synonymously to "anonymous function" that can optionally reference the outer scope (becoming a closure). Agreed, it's unacceptable in JavaScript and strictly speaking incorrect. Updated the article accordingly.

The OOP remark referred to inability to use arrow functions as class constructors. See the code example in the comment below. Will try to rephrase or expand on this topic to avoid confusion.

P.S.

the best way to get the right answer on the internet is not to ask a question; it's to post the wrong answer.

Cunningham's Law

Thanks!