JavaScript arrays: copying, transferring and merging
This series of articles mainly concentrates on working with JavaScript arrays. This is the third article in the series. It mainly concentrates on working with multiple arrays effectively. You can reuse these scripts to inject into server side controls easily (especially in .NET and Java).
JavaScript arrays: copying, transferring and merging - How to merge two arrays into a single array using JavaScript (Page 4 of 5 )
In our previous sections, we managed to copy or transfer the information available in one array to another. In this section, we shall deal with merging two arrays into a new array.
Now, let us try to develop a simple script (JavaScript) which merges two arrays into the third array. Have a look at the following code: