Hey everyone,
Need a bit of guidance here 😆 For the life of me, i can't see this.
export const formatTaskList = (tasks) =>
{
for (let i = 0; i < tasks.length; i++)
{
if (tasks[i].status == 'DONE')
{
tasks[i] = '\u2705' + ' ' + tasks[i].title;
}
else
{
tasks[i] = '\u274c' + ' ' + tasks[i].title;
}
}
return tasks;
}
Apparently my code fails on the 5th step -
- Each element of the array returned from formatTaskList should include the task title
I understand why - my output of tasks doesn't contain a title property anymore but i just can't see how i can approach this. Tried mapping to a new array (failed miserably), tried filtering, tried a few other stuff which didn't work.
Any hint would be greatly appreciated! Thanks!