Learn fetch and promises fcc Authors Page step 3

Step3 instruction “Chain the .then() method to your fetch call.
Inside the .then() method, add a callback function with res as a parameter, then log the res to the console so you can see the Response object.
Open your console and expand the Response object to see what it contains.
Again, don’t terminate the code with a semi-colon yet.”
Code

https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-fetch-and-promises-by-building-an-fcc-authors-page/step-3
fetch('https://cdn.freecodecamp.org/curriculum/news-author-page/authors.json').then((res) => res)
console.log(res);

Error Msg: “You should log the ‘res’ parameter to the console so you can see the ‘Response’ object.” “ReferenceError: res is not defined”

https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-fetch-and-promises-by-building-an-fcc-authors-page/step-3

you need to do what you are instructed to do in the function, res doesn’t exist outside the callback function so you need to use it inside the callback function

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.