let arrA = 1 2;let arrB = 3 4使用扩展运算符合并数组
可以使用扩展运算符将两个数组合并:
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/hNPa 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
可以使用扩展运算符将两个数组合并:
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/hNPa 著作权归作者所有。请勿转载和采集!