hello I have a list of projects listOfPhasesWithTasks which I get from backEnd. I assigned it to a local variable filteredPhasesWithTasks which I'm using in the rest of the project. It is supposed to work as a backup. When I'm doing filtering like this :
this.filteredPhasesWithTasks.forEach((phase) => {
phase.tasks = phase.tasks.filter(task => task.taskName !== null && task.taskName.toUpperCase().includes(filterParam.taskName.toUpperCase()));
});
I don't get why this changes my listOfPhasesWithTasks as well. I'm expecting that it would change only filteredPhasesWithTasks as code says.