I completed this exercise. But the current status of this exercise’s forum makes it clear that it was recently converted from a “Workshop” where we’re guided step-by-step to a “Lab” where we’re meant to write our own code. The transition wasn’t smooth. I have two “helpful hints” for future people attempting it:
First, steps 8-12, concerning the avatars
function, need a major rewrite, particularly step 9. In step 9, you’re meant to iterate over the posters
array and pull the needed data from the corresponding entry in the users
array. That could be made clearer. The learner should also be made aware of the structure of those arrays.
Second, until the instructions are updated to tell us this structure, I’ve pulled this from the test page on GitHub: It’s the actual data that your avatars
function will be tested against. Hopefully you can figure out the structure from this.
const posters = [{ user_id: 6 }, { user_id: 285941 }, { user_id: 170865 }];
const users = [
{
avatar_template:
'/user_avatar/forum.freecodecamp.org/quincylarson/{size}/212400_2.png',
id: 6,
name: 'Quincy Larson',
username: 'QuincyLarson'
},
{
avatar_template:
'/user_avatar/forum.freecodecamp.org/jwilkins.oboe/{size}/179497_2.png',
id: 285941,
name: 'Jessica Wilkins',
username: 'jwilkins.oboe'
},
{
avatar_template:
'/user_avatar/forum.freecodecamp.org/ilenia/{size}/270648_2.png',
id: 170865,
name: 'Ilenia',
username: 'ilenia'
},
{ id: 20 }
];
(Since I know @ILM is going to suggest it anyway: I’m in the process of writing this up as an issue on Github.)
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:139.0) Gecko/20100101 Firefox/139.0
Challenge Information:
Build an fCC Forum Leaderboard - Build an fCC Forum Leaderboard