Quiz 131 - Async await with try catch Javascript

  Рет қаралды 26

Code Gyaan

Code Gyaan

2 ай бұрын

The key to getting this question right is that async functions return a new promise.
console.log(a() === b()): false. async functions always return a new promise, so even if a() had the exact same implementation as b() (or vice-versa), it would still return false. However, do note that a() returns the promise returned by f() wrapped in another promise, while b() returns the result of the promise returned by f() wrapped in a promise.
console.log(b() === c()): false. b() returns a new Promise object wrapping the result of the promise returned by f(), while c() returns the original Promise from f().
console.log(a() === c()): false. a() returns the promise returned by f() in another new promise, while c() just returns the promise returned by f().

Пікірлер
Nastya and SeanDoesMagic
00:16
Nastya
Рет қаралды 36 МЛН
Я обещал подарить ему самокат!
01:00
Vlad Samokatchik
Рет қаралды 8 МЛН
БАБУШКИН КОМПОТ В СОЛО
00:23
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 17 МЛН
Async JS Crash Course - Callbacks, Promises, Async Await
24:31
Traversy Media
Рет қаралды 1,4 МЛН
How to Use GPT 4 Free (without ChatGPT Plus)
4:56
Code Gyaan
Рет қаралды 743
These CSS PRO Tips & Tricks Will Blow Your Mind!
8:48
Coding2GO
Рет қаралды 155 М.
5 JavaScript Concepts You HAVE TO KNOW
9:38
James Q Quick
Рет қаралды 1,4 МЛН
Coding Shorts #104: Can We Do Better Than Swagger?
11:03
Shawn Wildermuth
Рет қаралды 6 М.
Building Fluent Interfaces in TypeScript
16:15
Andrew Burgess
Рет қаралды 13 М.
Nastya and SeanDoesMagic
00:16
Nastya
Рет қаралды 36 МЛН