this post was submitted on 05 Aug 2023
8 points (100.0% liked)
JavaScript
1972 readers
3 users here now
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I would recommend watching a video on how concurrency in JavaScript works. It should make everything clear for you about Promises and async await.
https://youtu.be/8aGhZQkoFbQ
Anyway, what do you want to achieve? There are many ways to go about it, at least in JS, where top level await is not a thing.
Do you want fetched data render somewhere? Or maybe that's part of your backend and you want to do something with it?