this Keyword in JavaScript - JavaScript Tutorial 79

preview_player
Показать описание
Notes for You:: this Keyword in JavaScript - JavaScript Tutorial 79
- is a special keyword present inside every constructor function & methods.
- is a reference variable, which always points to the object with which we are currently working.
- is used to access members (i.e. attributes & behaviors) of the currently working object.

Actual Code:

function Rectangle(width,height)
{
{
}
}
var rect1 = new Rectangle(5,5);

var rect2 = new Rectangle(6,6);

Behind the scene code:

function Rectangle(width,height,this)
{
{
}
return this;
}
var rect1 = new Rectangle(5,5,#1);

var rect2 = new Rectangle(6,6,#2);

Notes:
- replace < with less-than symbol.
- replace > with greater-than symbol.

=========================================

Follow the link for next video:
JavaScript Tutorial 80 - Difference between prototype and _proto__ in JavaScript

Follow the link for previous video:
JavaScript Tutorial 78 - How to create Objects using Constructor function in JavaScript

=========================================

JavaScript Tutorials Playlist:-

=========================================
Watch My Other Useful Tutorials:-

jQuery Tutorials Playlist:-

jQuery UI Tutorials Playlist:-

Bootstrap Tutorials Playlist:-

=========================================

► Subscribe to our YouTube channel:

► Visit our Website:

=========================================
Hash Tags:-
#ChidresTechTutorials #JavaScript #JavaScriptTutorial
Рекомендации по теме
Комментарии
Автор

SUBSCRIBE, SHARE & SUPPORT:
VISIT & LEARN AT FREE OF COST:

ChidresTechTutorials
Автор

Truly an amazing explanation...First time i am seeing a tutorial which has explaines to the core level..great:)

cmonbrainy
Автор

AWESOME, thanks with "this" video my misconception about "this" as completely gone. You are the best :)

dheerajmantena
Автор

Very nice video.. thank you so much for your dedication and detail explanation ..way of explanation is simply outstanding .

vaishaliuchekar
Автор

Thank you, this is the best video I have watched on this topic and it has made me understand this concept!

oamarkanji
Автор

new keyword is the keyword that make (this) keyword to work otherwise this keyword always refer to window object if u omit new in constructor this will refer to window and error will occur ur code

zunairullah
welcome to shbcf.ru