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

Which built-in method removes the last element from an array and returns that element?

708


What is stack queue?

688


Explain higher-order functions in javascript?

711


Why is var better than let?

734


How are javascript and ecma script related?

723


What are the different objects used in javascripts?

733


Where do you put javascript in html?

693


What is an ECMAScript?

749


Name some of the ways in which Type Conversion is possible?

739


What is the way to get the status of a CheckBox?

880


Difference between Client side JavaScript and Server side JavaScript?

905


What percentage of websites use javascript?

709


what is the difference between wrappers and primitives es: diff between int i=200 in primitives and integeri = new integer(54)

2167


What is use of JavaScript and jquery?

803


What is argument objects in javascript & how to get the type of arguments passed to a function?

718