This

this is the object that the function is a property of

this can also be thought of as whatever to the left of . is referring to.

In the Global context this will refer to the Window object.

Examples

// What would `a()` print out
const a = function(){
    console.log(this);
    const b = function() {
        console.log(this);
        const c = {
            hi: function(){
                console.log(this);
            }
        }
        c();
    }
}
a();

Last updated