I have an array of array of objects (from a class) which is an attribute of my component and a function that takes it as an argument.
myFunc(MyClass[][]) {...}
In another function I modify this array of arrays. But sometimes I want to reverse the changes. I tried to to do a copy of it like that :
let temp = myArray.map(line => Object.assign([], line.map(obj => Object.assign({}, obj))));
When I log in the console it is identical. Then I replace the attribute with the copy if I need to reverse the changes. But when myFunc is called I got this :
ERROR TypeError: "myFunc is not a function"
The function works prefectly fine when I don't use a copy. Why is it happening ?