I don’t want to poo-poo on this article because I think it’s well intended. However, to add to what some other folks pointed out, function expression and function declaration have nothing to do with hoisting. It’s the fact that you used const that affects the hoisting. If you declare the function with var then you will experience the same affect of hoisting.

Regarding named functions vs. anonymous functions, there is something to be said about the debugging process and how named functions can give you a better idea of where the error happened.

Finally, you may want to mention that there are some clear differences between arrow functions and traditional functions. The most important difference is that arrow functions do not have scope, so the this keyword may behave different than in a normal function, in ways that are unexpected (or expected). Also, within an arrow function, you have no access to the arguments keyword.

I don’t like to be the person that yells, “You’re wrong”, but in this case, I think you’ve accidentally shared misleading information which could negatively impact others.

Full Stack @Revealbio | Author of Vuetensils & Particles CSS | Panelist @ViewsOnVue | Board Member @sandiegojs

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store