Created
April 4, 2020 20:32
-
-
Save tubbo/45a0beeb24a7e515897da501a381d7f8 to your computer and use it in GitHub Desktop.
new syntax for changing how this-binding to functions works. just an idea for now.
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
class App { | |
ready() { | |
alert("hello") | |
} | |
} | |
const app = new App() | |
document.addEventListener("DOMContentLoaded", app.ready.bind(app)) | |
// or | |
document.addEventListener("DOMContentLoaded", () => app.ready()) |
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
class App { | |
ready() { | |
alert("hello") | |
} | |
} | |
const app = new App() | |
document.addEventListener("DOMContentLoaded", app->ready) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Meh, nothing special.