this
this; // window
var obj = {
a: function() {
console.log(this);
}
};
obj.a(); // obj
var a2 = obj.a;
a2(); // windowvar obj2 = { c: "d" };
function b() {
console.log(this);
}
b(); // Window
b.bind(obj2).call(); // obj2
b.call(obj2); // obj2
b.apply(obj2); // obj2화살표 함수
Last updated
Was this helpful?