JSFiddle - React, Tailwind, and code Playground
JavaScript
var mutateObject = { name: 'Alex' };
var testArray = [mutateObject];
var testArrayMutableCopy = testArray.slice();
console.log(testArrayMutableCopy);
testArrayMutableCopy[0].name = 'Dan';
console.log(mutateObject);