Fetch() GET Requests III 4/12


#1

Hello, I am currently dealing with this exercise

https://www.codecademy.com/courses/introduction-to-javascript/lessons/requests-ii/exercises/fetch-get-requests-iii?action=resume_content_item

Here is the code I am dealing with

fetch(endpoint).then((response) => {
    if(response.ok){
  renderJsonResponse(response);
}
throw new Error('Request failed!');
 

}

in step 8 and 9 it says:

8.
Blockquote Delete renderJsonResponse(response) and replace it with return response.json() .
By returning response.json() , the next function that is .then() chained to it will receive a Promise with JSON data.
9.
Below the condition’s code block, add this code to raise an exception if the request failed: throw new Error('Request failed!');

After applying this step, I no longer get any outputs when I input any text in the textbox and submit it.
I have refreshed it many times (pressing Run), but I don’t see the problem.
I though it might be a problem with syntax, but I tried “Get stucked” code, but no result as well.

Doing this exercise step by step I managed to finish the exercise but with no outputs or results.

Can someone tell me what went wrong?