Build an fCC Forum Leaderboard - Build an fCC Forum Leaderboard

Tell us what’s happening:

Can’t seem to pass the “Catch the error” bit. I definitely am catching the errors though. Sorry for slightly messy code, I didn’t expect this to see other eyes, and I completely understand I should be in the habit of cleaner code.

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36 Edg/135.0.0.0

Challenge Information:

Build an fCC Forum Leaderboard - Build an fCC Forum Leaderboard

function fetchData(){

return fetch(“https://cdn.freecodecamp.org/curriculum/forum-latest/latest.json”).then(response => {

return response.json()}).then(data =>
{
//console.log(data.topic_list.topics);
showLatestPosts(data);

}).catch(error => console.log(error));

}

// only step is not passing is the error one.

It’s ok! figured it out from looking though the post. I assumed it wanted a a-synchronous function, but they specifically wanted an a-sync function. I just thought it wasnt something a-synchronous in general! I still think mine should have passed though because .then is still a valid way of writing the function.

1 Like