I have an array of objects like this:
const arrA = [{a: true}];
And I create a copy of the array like so:
const arrB = Array.from(arrA);
But when I modify the value of the object in arrB, the value in arrA gets modified too.
arrB[0].a = false
// arrB = [{a:false}]
// arrA = [{a:false}] - gets modified also
How do I modify the object values in the cloned array without modifying the original array.
const arrB = Array.from(arrA).map(o => Object.assign({},o));