Merge and alternate 2 arrays into single array
<p>I have beginner scripting skills and am using a form of JavaScript, ECMA-262 that is found in a program called Opus Pro (Digital Workshop, UK).</p>

<p>I've been searching online, without success, to find a way to merge and alternate number elements from 2 arrays into a third merged array. I've found a few scripts on this site, but they use functions like "push" which are not found in this script language, so can't be used.</p>

<p>My current script which creates one array for a set of randomly chosen numbers, (math.random),1-6, needs to be modified to create the 2 arrays (1-3 and 4-6), then alternately merge a value from the first array with a value from the second array, until the new array has 6 values taken from these (sub-) arrays:</p>

<p>current, unmodified script:</p>

<pre><code>function separate()
{
  for(i=1;i&lt;=listamount;i++)
     {
     //create 6 random numbers from 1-6
     temp = Math.round(Math.random()*(6))
     if (temp == 0){temp = 1}
     if (temp == 7){temp = 6}

        randomset[i] = temp
     }         
}
</code></pre>

<p>This needs to be revised so that the final randomlist array (call it newrandomlist[i]) would be an alternating mix like 2,6,1,4,3,5, but merged from 2 randomly ordered/created sub-arrays (1-3 and 4-6). Alternating values, from each randomly ordered/constructed sub-array, are critical to the functioning of the rest of the scripts in the project. I've tried any number of ideas, all unsuccessfully.</p>

<p>Any help appreciated.</p>
