What is the importance of Promise and async wait functions?

What are the importance of Promise and async wait functions in JavaScript?

Can one do without them?

You can use them for a couple of things. But the immediate one that comes to mind is that when you’re loading resources from other urls, your website won’t have all it needs to run right away. Sometimes a block of code is dependent on outside information and you don’t want it crashing or showing something undesired until you’re sure it has the information it needs.

It’s an incredibly powerful tool.

1 Like

Thank you. I will also appreciate it if you kindly explain it further in a bit more detail.

I would look at the mdn documentation, scroll down and play with the code that they give. They explain it a lot better than I can! I usually like to do this in node when possible so that it’s more interactive (but that’s not necessary).

OKay, thanks.

What is its real world use case?