Created
November 23, 2017 15:01
-
-
Save nilshartmann/d530785e6e9bce58b8ac97d2e63f9e33 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 Hello { | |
async greet() { | |
return new Promise(res => { | |
setTimeout(() => res("Hallo Welt"), 1000); | |
}); | |
} | |
} | |
const hello = new Hello(); | |
(async () => { | |
try { | |
const greet = await hello.greet(); | |
console.log("Greet: " + greet); | |
} catch (e) { | |
console.error("could not start: ", e); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment