扩展运算符
作者:互联网
// 数组合并 let ary1 = [1, 2, 3]; let ary2 = [4, 5, 6] let ary3 = [...ary1, ...ary2]; console.log(ary3); // [1, 2, 3, 4, 5, 6]
// 合并数组的第二种方法 let ary1 = [1, 2, 3]; let ary2 = [4, 5, 6] ary1.push(...ary2);
console.log(ary1); // [1, 2, 3, 4, 5, 6]
var oDivs = document.getElementsByTagName('div'); console.log(oDivs); var ary = [...oDivs]; console.log(ary);
标签:...,console,log,ary2,ary1,扩展,运算符,let 来源: https://www.cnblogs.com/ericblog1992/p/13073179.html