First note that this is a question from my Redux code HERE.
Okay so lets say I want to edit the property of 'status' from "pending" to "deleted" to a specific property of an object within an array, how would I be able to do this using Object.Assign for the following examples:
Example a: (notice the the array of objects is stored within an object itself)
const plan = {
task: [
{
id: 1,
description: "This is a task",
status: "pending"
},
{
id: 2,
description: "This is a second task",
status: "pending"
}
]
}
Example b: (A simple array of elements whose elements are objects)
const task2 = [
{
id: 1,
description: "This is a task",
status: "pending"
},
{
id: 2,
description: "This is a second task",
status: "pending"
}
]