Created
March 15, 2019 02:12
-
-
Save rhwlo/06f88d64530f6da1460cfcb9800a1ab2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const f = { | |
m() { | |
return this.n(); | |
}, | |
n() { | |
return "hi!"; | |
} | |
}; | |
f.m(); // "hi!" | |
f.n(); // "hi!" | |
detachedM = f.m; | |
detachedM(); // raises an exception: this.n is not a function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment