If you are a JS dev, After learning the fundamentals. You have to learn Async, Await, Callbacks and Promises. This repository provide several easy examples which can show you how they are working.
- Async
- Await
- Callbacks
- Promises
- Async: https://basemax.github.io/PromisesAsynchronousJS/async.html
- Callbacks: https://basemax.github.io/PromisesAsynchronousJS/callbacks.html
- Promises: https://basemax.github.io/PromisesAsynchronousJS/promises.html
The await operator is used to wait for a Promise. It can only be used inside an async function within regular JavaScript code; however it can be used on its own with JavaScript modules.
An async function is a function declared with the async keyword, and the await keyword is permitted within it. The async and await keywords enable asynchronous, promise-based behavior to be written in a cleaner style, avoiding the need to explicitly configure promise chains.
Promises are the foundation of asynchronous programming in modern JavaScript. They make it easier to express and reason about sequences of asynchronous operations without deeply nested callbacks, and they support a style of error handling that is similar to the synchronous try... catch statement.
Read more:
- https://developer.mozilla.org/en-US/docs/Glossary/Callback_function
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function
- https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Asynchronous/Promises