Which of the following is true regarding the 'this' keyword inside an arrow function?

  • The 'this' keyword in an arrow function refers to the global object.
  • The 'this' keyword in an arrow function refers to the object that contains the arrow function.
  • Arrow functions do not have a 'this' keyword.
  • The 'this' keyword in an arrow function refers to the 'this' value of the containing lexical context.
In arrow functions, the value of 'this' is inherited from the surrounding lexical context, which means it refers to the 'this' value of the containing function or block. Unlike regular functions, arrow functions do not have their own 'this' binding.
Add your answer
Loading...

Leave a comment

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