JavaScript this Keyword Explained Simply

Опубликовано: 10 Февраль 2022
на канале: DevSage
15,008
767

In most cases, the value of 'this' is determined by how a function is called. 'this' usually refers to the object that is calling the current function. If a function, foo(), is called from the global scope ("foo()"), then 'this' will refer to the global object - the Window object. But if foo() is called from inside the scope of another object ("devsage.foo()"), then 'this' will refer to the object that is calling foo() - which is the 'devsage' object. Arrow functions don't provide their own 'this' binding so it inherits the 'this' value of the enclosing function.


📚Materials/References:

MDN Web Docs: https://developer.mozilla.org/en-US/d...

🌎 Find Me Here:

Twitter:   / realdevsage  
Discord:   / discord  
Ebooks: https://payhip.com/devsage
Merch: https://cottonbureau.com/people/devsage


Смотрите видео JavaScript this Keyword Explained Simply онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал DevSage 10 Февраль 2022. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 15,008 раз и оно понравилось 767 посетителям.