DEV Community

Discussion on: How to define a JavaScript function

Collapse
 
rakusan2 profile image
Tomas Rakusan

Do not forget to mention their differences
like how the standard function declaration enables the function to be called anywhere within the scope even before it is declared
(Ex: declare all of your function at the bottom of the file)

Or how the arrow function has a different definition of this
(For arrow functions it never changes even if the function is assigned to a different object)

Collapse
 
michelc profile image
Michel

Of course! But I wanted to keep it simple and limit myself to the syntax. It was better to avoid any reference to "this"...