var arr = [1,2,3,4,5] var [ ...arr2 ] = arr arr[2] = 5 console.log(arr) console.log(arr2)
本文标题:ES6扩展运算符实现数组的深拷贝
本文链接:https://www.haomeiwen.com/subject/dgralftx.html
网友评论