Question · JavaScript and TypeScript course · Module 2: Functions, Arrays and Objects

this Value in Object Methods

What does 'this' point to inside an object method in JavaScript?

Answer options

  • To the function in which it is used
  • To the object the method is called on (the one before the dot)
  • To the window object
  • To the object's prototype
Show the answer

Correct answer:

  • To the object the method is called on (the one before the dot)