Question 3
Assuming the URL gives a valid json response, what will be the output in the console?
fetch('https://study.iitm.ac.in/api/data') .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error(error));
console.log('End of script');The JSON data from the specified URL followed by “End of script”.
"End of script" will be logged first, followed by the JSON data.
An error will be logged, and the script will terminate.
"End of script" will be logged, but the JSON data retrieval will fail.