Are arrow functions hoisted in JavaScript?
No, not as functions. Arrow functions are function expressions assigned to a variable. The variable is hoisted (undefined with var, TDZ with let/const), but the function body is only assigned at the declaration line.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in Hoisting With Arrow Functions and Regular Functions
With var, TypeError: x is not a function (because the variable is undefined). With let or const, ReferenceError because the variable is in the Temporal Dead Zone.
Yes. Regular function declarations are hoisted with their entire body during the memory allocation phase, so they can be called before their declaration line.
Use regular function declarations for top-level helpers you want to call from anywhere. Use arrow functions with const for most other cases, and always declare them before calling to avoid TDZ or TypeError issues.
Still have questions?
Browse all our FAQs or reach out to our support team
