- Tutorials
- JavaScript Tutorial
- JavaScript Asynchronous
JavaScript Asynchronous
12 lessonsAbout 72 minutesIntermediate
This part of the JavaScript Tutorial runs from JavaScript Asynchronous through to JavaScript Event Loop. There are 12 lessons here, and working through them takes about 72 minutes at a steady pace.
It follows on from JavaScript Events, so finish that first if you have not already — the examples below assume you are comfortable with it.
Each lesson below says what it covers before you open it. Read them in order the first time; afterwards this page works as a index you can jump back into when you need to check one thing.
- 1JavaScript AsynchronousAsynchronous JavaScript starts a slow job and carries on without waiting for it.
- 2JavaScript setTimeoutsetTimeout runs a function once after a delay.
- 3JavaScript setIntervalsetInterval runs a function over and over until you stop it.
- 4JavaScript Async CallbacksAn asynchronous callback is a function that runs once slow work has finished.
- 5JavaScript PromisesA promise is an object representing a value that is not ready yet.
- 6JavaScript Promise ChainingReturning a value from then passes it to the next then in the chain.
- 7JavaScript Promise Errorscatch handles a rejected promise, and finally runs whatever happened.
- 8JavaScript async and awaitasync and await let you write asynchronous code that reads like ordinary code.
- 9JavaScript async Error Handlingtry and catch handle errors in async functions the same way as anywhere else.
- 10JavaScript Promise.allPromise.all waits for several promises at once instead of one after another.
- 11JavaScript Fetch APIfetch requests data from a server and returns a promise.
- 12JavaScript Event LoopThe event loop decides what runs next when the call stack is empty.
