Facebook Pixel

Do arrow functions have their own this binding?

No. Arrow functions inherit this from their enclosing lexical scope. This is not a hoisting issue, but it matters when an arrow is defined inside a regular function whose this is set at call time.

Verify This Answer

Cross-check this information using these trusted sources:

More FAQs in Hoisting With Arrow Functions and Regular Functions

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.

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.

Still have questions?

Browse all our FAQs or reach out to our support team

Want to upskill yourself?

Our courses are taking a Coffee break, but your curiosity shouldn't. Stay engaged with namastedev linkedin, youtube, discord and other resources while you wait.

0
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.