The concat () method of arrays must be familiar to everyone. In this article, we will introduce the specific use of the concat () method of arrays in javascript. If you are interested, refer
The Code is as follows:
Concat () method of Array
Script
/*
The concat () method of the array:
1. This method does not change the existing array, but only returns a copy of the connected array.
2. Return a new array. This array is generated by adding all arrayX parameters to arrayObject.
If the concat () operation parameter is an array, the elements in the array are added instead of an array.
*/
Var arr1 = [123, "aaa"];
Var arr2 = [false, 333];
Var arr3 = [true, "ddd"];
// You can continue to connect to arrays or other elements.
Document. write (arr1.concat (arr2, arr3, "vvv") +"
"); // 123, aaa, false, 333, true, ddd, vvv
// The original array is not changed.
Document. write (arr1); // 123, aaa
Script