let that = {
listAll: [1, 2, 3]
};
let data = [4, 5, 6];
let mergedArray = that.listAll.concat(data);
console.log(mergedArray); // 输出: [1, 2, 3, 4, 5, 6]
console.log(that.listAll); // 输出: [1, 2, 3],原始数组没有改变
唯有美景,可以抚慰我的心灵!
let that = {
listAll: [1, 2, 3]
};
let data = [4, 5, 6];
let mergedArray = that.listAll.concat(data);
console.log(mergedArray); // 输出: [1, 2, 3, 4, 5, 6]
console.log(that.listAll); // 输出: [1, 2, 3],原始数组没有改变
唯有美景,可以抚慰我的心灵!