What is this in JavaScript?



What is this in JavaScript?..

Answer / hr@tgksolutions.com

this refers to the object that is executing the current function.
• In the global scope, this refers to window (in browsers).
• Inside an object method, this refers to the object itself.
• Inside an arrow function, this is lexically bound (inherits from the surrounding scope).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JavaScript Interview Questions

How do you disable javascript?

1 Answers  


How do I turn off javascript in chrome?

1 Answers  


What does the operator do in javascript?

1 Answers  


why can't we call a static method from a non-static method

1 Answers  


What is output of “20” + 20 + 20 and “20” + ( 20 + 20)? In javascript?

1 Answers  


Which built-in method returns the character at the specified index?

1 Answers  


What does the term sticky session mean in a web-farm scenario? Why would you use a sticky session? What is the potential disadvantage of using a sticky session?

1 Answers  


What makes something a function?

1 Answers  


What is the method for reading and writing a file in javascript?

1 Answers  


how can count show data in grid view using java script

0 Answers  


In how many ways a Javascript code can be involved in an HTML file?

1 Answers  


How can we establish connection with java and sql server?

1 Answers   TCS,


Categories