I am trying to extract the value of data.notes
. After implementing the code below, I noticed that the detailsOfCurrentNotes
value changes based on the data.notes
. Can anyone provide guidance on how to resolve this issue?
notes :Note[]
const detailsOfCurrentNotes = Object.assign({}, data.notes);
//the value of data.notes is being modified
// detailsOfCurrentNotes reflects these modifications as well