If you’re using arrow functions to define methods inside a class, those methods will not have access to the class’s instance without using _________.

  • super()
  • this
  • prototype
  • new
If you use arrow functions to define methods within a class, they will not have their own this context. Instead, they inherit the this context from the surrounding scope. To access the class instance within an arrow function, you need to use this. Hence, the correct option is this.
Add your answer
Loading...

Leave a comment

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