✅ Difficult JavaScript Interview Question 🔥 #javascript

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

test():
Assigning obj.b to test, takes the function b out of the obj object. When you call test(), it's no longer part of obj. In JavaScript, when you call a function like this, without an object in front of it (just test()), this no longer refers to obj. Instead, it refers to the global object (in browsers, that's window).
testArrow():
Similar to the second case, testArrow is an arrow function that lexically binds this from the global scope. Thus, this.a is still undefined.

SpecsyCoder
Автор

I like the video format! Also its been 2 hours.

thebanana
welcome to shbcf.ru