Concat method (array)
Returns a new array consisting of two or more arrays.
Array1.concat ([Item1 [, item2 [,... [, itemn])
Parameters
Array1
Required. The array object to be connected to all other arrays.
Item1,..., itemn
Optional. To connect to another project at the end of array1.
Description
The Concat method returns an array object that contains the connection between array1 and any other projects provided.
Project to be added (Item1... Itemn) is added to the array from left to right. If an item is an array, add its content to the end of array1. If the project is not an array, add it as a single array element to the end of the array.
Copy elements from the source array to the result array as follows:
For the object parameters copied from the array being connected to the new array, the Copied object still points to the same object. Any change in the new array and source array will lead to another change.
Only the values of the values or strings connected to the new array are copied. Changing the value of a group does not affect the value of another array.
Example
The following example illustrates the usage of the Concat method when arrays are used:
Function concatarraydemo (){
VaR a, B, c, d;
A = new array (1, 2, 3 );
B = "jscript ";
C = new array (42, "VBScript );
D = A. Concat (B, c );
// Returns the array [1, 2, 3, "jscript", 42, "VBScript"]
Return (d );
}