📜  连接数组的更好方法 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:06.129000             🧑  作者: Mango

代码示例1
let arr1 = [0, 1, 2];
let arr2 = [3, 4, 5];

arr1 = [...arr1, ...arr2];
//  arr1 is now [0, 1, 2, 3, 4, 5]
// Note: Not to use const otherwise, it will give TypeError (invalid assignment)