目录

concat()

concat()方法返回一个由此数组组成的新数组,该数组与两个或多个数组连接。

语法 (Syntax)

array.concat(value1, value2, ..., valueN);

参数 (Parameters)

  • valueN - 要连接到结果数组的数组和/或值。

返回值 (Return Value)

返回一个新数组。

例子 (Example)

var alpha = ["a", "b", "c"]; 
var numeric = [1, 2, 3];
var alphaNumeric = alpha.concat(numeric); 
console.log("alphaNumeric : " + alphaNumeric ); 

输出 (Output)

alphaNumeric : a,b,c,1,2,3
↑回到顶部↑
WIKI教程 @2018