Fetch() GET Requests III - stuck on 4/18



I’ve been trying for a while to see what is wrong with my code on module 12 (Requests II) of the JavaScript course but can’t identify the issue, so would be grateful for your enlightened eyes!

I can’t seem to get past the last step of chaining a then. method to another then. method when using the fetch() function to create a GET request.

fetch('https://api-to-call.com/endpoint').then(function success(response) {
  if(response.ok) {
    return response.json();
    throw new Error ('Request failed!');
	function failure(networkError) {
).then(jsonResponse => jsonResponse);


This topic was automatically closed after 7 days. New replies are no longer allowed.