Created
May 17, 2021 15:25
-
-
Save maxmatthews/f12cf0d5402a1b301876dea8cac11593 to your computer and use it in GitHub Desktop.
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 toDoList = [ | |
{ name: "Import Export homework", status: "done", daysLeftToDo: 1 }, | |
{ name: "Array homework", status: "in progress", daysLeftToDo: 1 }, | |
{ name: "Chat App homework", status: "in progress", daysLeftToDo: 1 }, | |
{ name: "Add to Capstone website", status: "to do", daysLeftToDo: 2 }, | |
{ name: "Finish Resume", status: "in progress", daysLeftToDo: 3 }, | |
]; | |
const priorityTasks2 = toDoList.filter( | |
(task) => task.status !== "done" && task.daysLeftToDo < 2 | |
); | |
console.log(priorityTasks2); | |
const priorityTasks2Names = priorityTasks2.map((task) => task.name); | |
console.log(priorityTasks2Names); | |
console.log( | |
toDoList | |
.filter((task) => task.status !== "done" && task.daysLeftToDo < 2) | |
.map((task) => task.name) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment