Skip to content
0:00 / 0:00

#asyncawait#promises#javascriptasync

The Async Await Episode I Promised

Fireship

4.3M subscribers • 49 videos on Hallway

YouTube
  • Recommended by 3 people: 3 in engineering communities.
  • Presented by Jeff Delaney
  • Linked in the descriptioncodediodeio/async-await-pro-tips
  • May be out of date. Uploaded 8 years ago, in an area where tools change fast.

Beginner. No background in the topic needed.

1.2M views8 years ago3 recommendations

Programming languagesWeb developmentJavaScriptTypeScript

Jeff Delaney explains how to write clean asynchronous JavaScript code using async and await with practical examples.

The await is over! Learn how to make your JavaScript Promise code beautiful and concise with async-await github.com/codediodeio/async-await-pro-tips Jake Archibald's Talk: youtu.be/cCOL7MC4Pl0 Demos with Angular: youtube.com/channel/UCYFd7Qy93YP7gPERnxP545A

Why it's here

3 people recommend this

What people say. Recommended as an excellent, clear explanation of async/await and promises for developers returning to JavaScript.

u/rster2002in r/node • Recommends

On “Retry loop with a pause between attempts”

Async await is only for when working with promises. setTimeout does not return a promise, so async await would not work. To get it to work you would have to create something like this: ```javascript const wait = delay => { return new Promise (res => { setTimeout(() { res(); }, delay); }); } // Your function await wait(2000); ``` Also, you'll need to make `waitForDevice` return a promise. ```javascript const wait = delay => { return new Promise(res => { setTimeout(() => { res(); }, delay); }); } const waitForDevice = (device) => { return new Promise(async (res, rej) => { // A promise exposes two functions: respond and reject // If you then performed…

u/kiipain r/node • Recommends

On “Issue with recursion and async function”

Maybe this video here can help to clear it up for you. It helped me when I got back into JS after being "out" for a few years when promises and async/await was introduced.

u/Mirkin321in r/node • Recommends

On “Variable stays undefined”

…could try async/await and await the variable promise to resolve. Or, you could move you console.log up into the body of the con.query function, so that it logs it after it is resolved. Either works, but async/await or just creating promises will serve you better in the long run if you need to do alot of this kind of thing :) I like this video: link to this video Also this one: [video…