Created
May 9, 2017 16:07
-
-
Save reflectiondm/45dbdfd445f5edde292649a28c8fd03c to your computer and use it in GitHub Desktop.
This file contains 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 Greeter { | |
constructor(greeting) { | |
this.greeting = greeting; | |
} | |
call(message) { | |
console.log(`${message}, ${this.greeting}`); | |
} | |
} | |
const greeter = new Greeter('Dude'); | |
greeter.call('Hello'); | |
const p = new Promise((res, rej) => rej('oh, man!')).catch(greeter.call); | |
const detatchCaller = greeter.call; | |
detatchCaller('omg'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment