ga-wdi-boston / js-function-context-this

Other
0 stars 126 forks source link

Clarify examples #21

Closed payne-chris-r closed 7 years ago

payne-chris-r commented 8 years ago
function Deathstar() {
    console.log(this);
}

let deathstar = new Deathstar();
// this === shiny new Deathstar instance
jrhorn424 commented 8 years ago

Yes, it works.

I agree it could be changed:

function Deathstar() {
    console.log('this is ', this);
}

Invocations of console.log should also probably change in other examples as well.

gaand commented 8 years ago

Resolving this issue should take into account #15