Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialKhaled Adad
14,953 PointsCode works in repl.it but not here, unknown error
unfinishedTasks = todos
.filter(todo => !todo.done)
.map(todo=> ${todo.todo}
)
what's the error for?
const todos = [
{
todo: 'Buy apples',
done: false
},
{
todo: 'Wash car',
done: true
},
{
todo: 'Write web app',
done: false
},
{
todo: 'Read MDN page on JavaScript arrays',
done: true
},
{
todo: 'Call mom',
done: false
}
];
let unfinishedTasks;
// unfinishedTasks should be: ["Buy apples", "Write web app", "Call mom"]
// Write your code below
unfinishedTasks = todos.filter(todo => !todo.done).map(todo => `${todo.todo}`)
2 Answers
Zaid Khan
12,769 PointsIt should've worked. Sad to hear that challenge accepts only a particular set of solutions.
Just remove the template literals and you will be fine.
Zaid Khan
12,769 Pointshmm could be
Khaled Adad
14,953 PointsKhaled Adad
14,953 PointsRemoving the template literals solved the issue. I suppose they're redundant in this case and maybe the tests prevent some type of SQL injection.