Promises vs Async-await in JavaScript

preview_player
Показать описание
#javascript #async #promise #await
Donate us:

callback vs promises:

Join facebook group:

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

we don't need to use then catch in case of async await.. It was pending because you are returning the await state. it should be like let response = await calculate(1, 2, 3) return response thats it and for error handling we can use try catch throw

bibhasash
Автор

I personally use asynchronous functions all the time never have encountered a situation where i prefered Promise over async await

fxstreamer
Автор

Very nice explained. I watched some other tutorials concerning this topic but it was some how difficult for me to understand. But your explanation and the examples you used made me understand how promises and async-await works. Big thanks!

leacocotube
Автор

nice video, but there is no need using repeating .then().catch() on the await/async function since u can use try{} catch(){} block

martinschukwuma
Автор

thanks sir... this is very simple and 100% perfect

LovingLego
Автор

I find the example a bit awkward in the sense that you are using a different constant with the name add in the async-await example but not in the first promise example. This makes it hard for me to understand how these blocks of code are different as they seem to be entirely different pieces of code. Also why write "const calculate = () => {}" instead of "function calculate() {}" at line 3? Any specific reason or just preference in coding style?

Barrosy
Автор

Is there any performance difference between them?

helcinho
Автор

Nice explained it's beneficial for me 👍

mayurkadam
Автор

so much confused video you cant express it

harshshah