1
0
This commit is contained in:
Jason Williams
2019-08-11 12:56:43 -06:00
parent 6fe77562a9
commit 63e639fab3
3 changed files with 35 additions and 15 deletions

View File

@@ -0,0 +1,24 @@
//
// Goal: Create method to get incomplete tasks
//
// 1. Define getTasksToDo method
// 2. Use filter to to return just the incompleted tasks (arrow function)
// 3. Test your work by running the script
const tasks = {
tasks: [{
text: 'Grocery shopping',
completed: true
},{
text: 'Clean yard',
completed: false
}, {
text: 'Film course',
completed: false
}],
getTasksToDo() {
return this.tasks.filter((task) => task.completed === false);
}
}
console.log(tasks.getTasksToDo())