this post was submitted on 05 Aug 2023
8 points (100.0% liked)
JavaScript
1700 readers
1 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
If you want to continue in the same function you'll need to use async/await. In your case:
Realize that you have to add async to your function and await to your fetch call. Also take into account that if your function returns anything, it'll now return a Promise instead.