Can an arrow function have its own this context?

  • Yes, it has its own this context
  • No, it shares the this context with the surrounding code
  • Yes, but it inherits the this context from the parent scope
  • No, it always refers to the global object
Yes, an arrow function has its own this context, which means it does not bind its own this but retains the this value of the enclosing lexical scope. This behavior can be advantageous in certain scenarios.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *