DEV Community

Discussion on: Named functions vs Functions as variables in JavaScript

Collapse
 
arnaudmorisset profile image
Arnaud Morisset • Edited

I use both of them depending of the use case.

I tend to prefer the function as a variable with arrow syntax 'cause it make the current context unreachable (binding to the parent context instead). It enforce future developers to write pure functions instead of relying on this.