Created
February 9, 2018 12:15
-
-
Save trygve-lie/f07b517739d8be03892e92cc4068f2a1 to your computer and use it in GitHub Desktop.
async.constructor.js
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 Foo { | |
constructor(numb) { | |
this.numb = numb; | |
} | |
then(success, fail) { | |
setTimeout(() => { | |
success(this.numb); | |
}, 500); | |
} | |
} | |
async function main() { | |
const n = await new Foo(42); | |
console.log(n); | |
}; | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment