Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const futureFunc = () => {
- return new Promise ((resolve, reject) => {
- setTimeout(() => {
- resolve('This is Dwight, from the future')
- }, 1000)
- })
- }
- const otherFunc = async () => {
- let messageFromTheFuture = await futureFunc()
- return `${messageFromTheFuture}!!!!`
- }
- const value = otherFunc()
- value.then((val) => console.log(val))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement