When a function expression is made async, it returns a ______.
- Promise
- Callback
- Generator
- Class
When a function expression is marked as "async," it returns a Promise. An async function can pause its execution and wait for the Promise to resolve or reject, which is helpful for handling asynchronous operations elegantly.
Loading...
Related Quiz
- What kind of problem might closures introduce in your code if not used properly?
- How does the for...of loop handle objects by default?
- To merge two arrays into a single array, you can use the _______ method.
- Which method is commonly used to change the text content of an HTML element using JavaScript?
- How can you implement a while loop without causing a browser to freeze in case of a long-running process?