Austin Gil
1 min readMar 9, 2020

--

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.

--

--

Austin Gil
Austin Gil

Written by Austin Gil

I want to help you build better websites. I create cool stuff for the web and share what I learn.

No responses yet