Web hosting india - A Array.concat() (Method) Array.concat() (Method) Concatenate arrays
A Array.concat() (Method) Array.concat() (Method) Concatenate arrays together. Availability: Property/method value type: JavaScript syntax: Argument list: The result of this method is a new array consisting of the original array, plus the concatenation. The values that are passed to the method are added to the end of the array. If arrays are passed, they are flattened and their individual elements added. The method returns an array consisting of the original Array plus the concatenated values. If Array1 contains “AAA”, “BBB”, “CCC” and Array2 contains “000″, “111″, “222″, then the method call Array1.concat(Array2) will return an array with all the elements in a single collection. The original arrays will be untouched. Warnings: . The concat() method will flatten arrays that are passed as arguments. However, it will not recursively flatten multi-dimensional arrays. Example code: ECMAScript edition 3 JavaScript 1.2 JScript 3.0 Internet Explorer 4.0 Netscape 4.0 Netscape Enterprise Server 3.0 Array object -myArray.concat(someValues, …) someValues A sequence of values to concatenate onto the array