Last active
May 3, 2020 23:02
-
-
Save anmolsukki/af74ca1d0f73f96ff0b44afbee4c8d11 to your computer and use it in GitHub Desktop.
[ Javascript ] arrow function refactor filter challenge (https://repl.it/@anmolsukki/refactorArrowFunction)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const tasks = { | |
task: [{ | |
text: 'Grocery shopping', | |
completed: true | |
},{ | |
text: 'Clean yard', | |
completed: true | |
}, { | |
text: 'Film course', | |
completed: false | |
}], | |
getTasksToDo(){ | |
return this.task.filter((task) => task.completed === true ) | |
} | |
} | |
console.log(tasks.getTasksToDo()) // [{ text: 'Grocery shopping', completed: true }, { text: 'Clean yard', completed: true }] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment