JavaScript async / await Explained

preview_player
Показать описание
In this tutorial, we'll take a look at the JavaScript async await keywords and look at some examples of how you would use this JavaScript feature in your code.

JavaScript async await Explained
-----------------------------------------------------
00:00 Introduction
00:24 Why Async / Await?
01:05 The Async Keyword
02:04 The Await Keyword
03:00 Example with Long Running Promises
03:59 Error Handling
04:47 Practical Example

— Follow Me —
— Thanks! —

So in the previous video on JavaScript promises we saw how you can handle multiple promises by chaining together .then() blocks.

In this JavaScript async await tutorial we'll take a look at the JavaScript async and await keywords and see how you can use these to provide 'syntactic sugar' on top of Promises to make your asynchronous code appear synchronous.

We'll first take a look at how the JavaScript async keyword works and what effect it has on applying it to an ES6 arrow function. We'll then see how you can use the JavaScript await keyword to store the result of a fulfilled promise inside a variable.

They'll also be a section where we look at how JavaScript async await error handling works to by using a standard try / catch block.

Finally, we'll finish off with a JavaScript async await Promise example that pulls some data from the GitHub API using the fetch API giving us a JavaScript async await fetch example that you can use in your own projects.

Рекомендации по теме
Комментарии
Автор

1:42 How does the console.log got the value without even providing it

kumarvishalben
Автор

Ayy What Happened about the payment tutorial

_.sunnyraj._