Arrow Functions vs Regular Functions

ES6 arrow functions are not just shorter syntax. They have fundamental differences in how they handle this, arguments, and constructors.

FeatureArrow FunctionRegular Function
Syntaxconst fn = () => {}function fn() {}
Best forCallbacks, short functions, methods needing outer thisMethods, constructors, when you need dynamic this
HoistingNot hoisted (expression)Yes (declaration form)
this bindingInherits from enclosing scope (lexical)Dynamic (depends on how called)
arguments objectNot availableAvailable
Can be constructorNo (cannot use new)Yes (can use new)

Verdict

Use arrow functions for callbacks and when you need lexical this. Use regular functions for object methods, constructors, and when you need the arguments object or hoisting.

Code Example

Javascript
Tip: Modify the code above and click “Run” to see the results

Related Tutorials

Related Glossary Terms