Question

What will be the output of the following JavaScript code when executed? let xhr = new XMLHttpRequest(); xhr.open("GET", "https://api.example.com/data", false); xhr.send(); console.log(xhr.responseText);

A A successful response from the server
B An error due to using a synchronous request
C undefined
D The text "GET request was successful"
E The server's HTML code
Practice Next

Relevant for Exams:

Hey! Ask a query