You are here:

Javascript/Doubts using this keyword in Javascript


In my project, we are using this keyword in many places. but i dont have idea for this keyword. Please explain that how to understand this?

Hi Mohanraj,

Thanks for your question. When used inside of a function, the "this" JavaScript keyword refers to the object within which the function is executing. It can be a confusing topic, because a function can be defined in one context, and executed with another using the .call() or .apply() methods. And when you instantiate a constructor function, the "this" keyword refers to the instance object itself, regardless of where that constructor is executed.

This topic can be a bit challenging to understand without code examples. Here are two blog posts I've already written that discuss this topic:

1) Understanding Context in JavaScript Object Literals:

2) What is the difference between an Object Literal and an Instance Object in JavaScript ?:

I hope this was helpful. Please feel free to follow-up with me directly if there are any other questions you may  have about the "this" keyword in JavaScript. I can be reached at:

Best Wishes,

Kevin Chisholm


All Answers

Ask Experts


Kevin Chisholm


I can answer questions about: JavaScript, Object-Oriented JavaScipt, JSON, AJAX, jQuery, HTML, CSS


I am a Front-End Web Developer living in New York City. I have provided services to titles such as,,,,,, and Being particularly passionate about Object-Oriented JavaScript as well as Web Standards, I spend a fair amount of time writing about / teaching Front-End Web Development techniques. In my free time I enjoy reading about advanced JavaScript, as well as Web Development trends and best practices. My Blog is: JavaScript-specific blog posts can be found here:

NYC Front-end Developers CSS3 / HTML5 The future of front end Front-End Engineers Javascript Syracuse University Alumni Network

Syracuse University - VPA - 1983 - 1987

Past/Present Clients

©2016 All rights reserved.