A(n) _______ function returns a promise.
- Synchronous
- Callback
- Async
- Static
An Async function returns a promise implicitly. When you declare a function as async, it means the function will always return a promise, allowing you to use await inside it to handle asynchronous operations more cleanly.
Loading...
Related Quiz
- What is the drawback of using "inheritance" through the prototype chain?
- In JavaScript, the ________ function is often used for delaying the execution of a function in an asynchronous manner.
- Which technology was NOT directly influenced by JavaScript's development?
- When defining a method in an object, the function associated with a property is referred to as a _________.
- You are building a single-page application, and you want to make an API call. You realize that you want to abort the fetch request if the user navigates away from the current page to avoid unnecessary data transfer. How can you achieve this?