Tasks 147
I am having this problem. Pls. let me know how it should get printed ? Please advise me of how to get rid of this error: "5. Each element of the array returned from formatTaskList should include the task title"
I am using tasks.title - for some reasons this editor here is not displaying array in square braces that i am typing [ ]
My code:
export const formatTaskList = (tasks) => {
for (var i = 0; i < tasks.length; i++){
if (tasks.status === 'DONE'){
tasks = Object.keys(tasks)[1] + ":" + '\u2705' + " " + tasks.title;
} else {
tasks = Object.keys(tasks)[1] + ":" + '\u274c' + " " + tasks.title;
}
}
return tasks;
}
My results:
[
'title:✅ Start learning JS on CoderslangJS',
'title:✅ Write my first program',
'title:✅ Set clear and achievable goals',
'title:❌ Be patient and learn every day',
'title:❌ Join Coderslang community'
]