JavaScript Async/await

preview_player
Показать описание
#javascript #async #await #fetchapi

An async function named fetchData is defined. Inside this function:
a. The fetch function is used to make an HTTP request to the specified URL (url).
b. The await keyword is used to wait for the response to be received from the server.
c. The response is then converted to JSON format by calling the .json() method on the response object.
d. The converted JSON data is assigned to the variable countries.
Рекомендации по теме
Комментарии
Автор

Brother your shorts are awesome.... You got a new subscriber.. ❤.. Thanks for such a nice and short solutions...

mzohaib
Автор

you solve my problem i was stuck since 2 hours.

zoyafatima
Автор

Basically 1 and 2 print first and then Brazil because it's calling it from the Internet?

THE-dlyk
Автор

async and await method make Asyc code sync???

MuhammadUsman-okvs
Автор

Is the rain and lightning real, or were they added in post?

TraceguyRune
Автор

Suppose if there is some condition in JavaScript where else part is not required so will it cause any issue e.g
If ()
Console log
Else if ()
Console log
Else if ()
Console log


In above example if we not use else block so will it cause any issue

appsgames