How can you make an asynchronous request to a server in JavaScript?
2025
How can you make an asynchronous request to a server in JavaScript?
Answer: C. Using the fetch API or XMLHttpRequest — Asynchronous requests to a server in JavaScript are commonly made using the fetch API or XMLHttpRequest. The async and await keywords help handle asynchronous…
- A.
Using the "async" keyword
- B.
Using the "await" keyword
- C.
Using the fetch API or XMLHttpRequest
- D.
By defining a callback function
Attempted by 57 students.
Show answer & explanation
Correct answer: C
Asynchronous requests to a server in JavaScript are commonly made using the fetch API or XMLHttpRequest. The async and await keywords help handle asynchronous code but do not themselves send the request.
Loading lesson…