JavaScript 数组合并:使用扩展运算符 (Spread Syntax)
使用扩展运算符将两个数组合并:可以使用扩展运算符将两个数组合并:
let arrA = [1, 2];
let arrB = [3, 4];
let mergedArray = [...arrA, ...arrB];
console.log(mergedArray); // [1, 2, 3, 4]
原文地址: https://www.cveoy.top/t/topic/pwUb 著作权归作者所有。请勿转载和采集!