filmov
tv
this Keyword in JavaScript - JavaScript Tutorial 79

Показать описание
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
- 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
Комментарии