Keeping Track of 'This' in JavaScript

preview_player
Показать описание
In Java, the special variable "this" is used to refer to an object. But following which object "this" refers to depends on the code you're executing and how "this" is used. In this JavaScript teaser, we help you keep track of a coding variable more slippery than a banana peel.

Follow O'Reilly Media:
Рекомендации по теме
Комментарии
Автор

Excellent tutorial of ```this``` keyword. Googled a lot for a better explanation on ```this``` keyword, but this is the best explanation one can get.

ElatiSheshanthReddy
Автор

Thank you so much. I have been struggling in understanding the concept of "this" f. It's solved within just 13 mins by watching this video.

cuongnguyenvanvu
Автор

My sincere and appreciative thanks for giving a pretty thorough explanation of such a mysterious and at times, misunderstood feature in JS.

oscarjim
Автор

leave it to o'reilly to make things even more confusing

gpicard
Автор

So I have a question... Which procedure to follow to call a function which is not part of a obj. Sending this as an argument or using .call().
And the must answer question would be.. Why to opt for that solution rather than other one?

roypedia
Автор

I feel like that first "banana slip" is more of a scope issue, than a THIS issue.

ElisandroDeLeon
Автор

One little suggestion: if the cursor is able to point at the words corresponding to the voiceover, it would be more helpful.

vic
Автор

What is the difference between methods and functions in JavaScript? Is the method and object same thing here?

zonayedpca
Автор

Excellent video. Just want a banana now....

blackviking
Автор

I can't hear anything is it muted?

TheCrimson
Автор

You speaking way to fast about this topic, when there is so many redundant words its really hart to grasp the concept.

Benas
Автор

'this' is a lot similar to 'self' from other languages like python.

triforcelink
Автор

I recommend not covering the code with "the results". It makes it difficult to look back and forth and compare.

parkingalertsigns
welcome to shbcf.ru