标签: javascript
两个年龄均更改为11。如何防止这种情况?
var complex = { 'name': 'aaa','age': 99 }; var arr = [complex]; var newArr = Array.from(arr); arr.push(newArr[0]); arr[1].age = 11; console.log(arr,newArr )