What is this in JavaScript?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What are JavaScript Cookies?

709


How to create function in JavaScript?

796


List different ways of empty an array in javascript?

631


Why is javascript good for websites?

680


How to test a string as a literal and as an object ?

782


Explain mul function in javascript?

722


How do you submit a form using JavaScript?

683


What is the use of debugger keyword in javascript?

678


how to validate the date(dd/mm/yyyy)using regular expression in javascript? It should also satisfy the leap year feb 29 problem. Please help me.

5947


Explain the process of document loading.

732


What is the use of dom?

719


What do you mean by script?

634


What is a function object?

725


What is the difference between textContent and innerText?

747


How to get the type of arguments passed to a function?

720