Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class A {
f() { console.log(1); }
g(){ setTimeout(function() { this.f(); }, 1000)}
}
function f() { console.log(2); }
var a = new A()
a.g()
> 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.