I have the following code:
let a = this.menu.getMenuItems().find((item) => item.$entityType === val);
let b = Object.assign({}, a);
this.dictChildren = b.children.map((item) => {
});
First I try to find element in array then create copy.
After I attempted to modify found element using map()
, despite
let b = Object.assign({}, a);
It modifies original array.
How map only copied object b?