title: Shuffle 4 arrays with paired objects, then push it
body: <p>I have 4 arrays which shuffle themselves, works as expected, so far so good.</p>
  <pre><code>let groupAB = shuffleArray([&quot;A&quot;, &quot;B&quot;,]); 
  let groupCD = shuffleArray([&quot;C&quot;, &quot;D&quot;,]); 
  let groupEF = shuffleArray([&quot;E&quot;, &quot;F&quot;,]); 
  let groupHG = shuffleArray([&quot;G&quot;, &quot;H&quot;,]);
  </code></pre>
  <p>but now i want to shuffle the group arrays and push it to a new existing array.</p>
  <p>I tried doing it so:</p>
  <pre><code>let availablePositions = [];
  let groupAB = shuffleArray([&quot;A&quot;, &quot;B&quot;,]); 
  let groupCD = shuffleArray([&quot;C&quot;, &quot;D&quot;,]); 
  let groupEF = shuffleArray([&quot;E&quot;, &quot;F&quot;,]); 
  let groupHG = shuffleArray([&quot;G&quot;, &quot;H&quot;,]);
  let availableGroups = shuffleArray([...groupAB, ...groupCD, ...groupEF, ...groupHG]);
      availablePositions.push(...availableGroups);
  </code></pre>
  <p>Which doesnt work as expected. e.g.: &quot;A&quot; &quot;B&quot; get split up and sometimes end up on the other side of the spectrum. To give some visualisation why this needs to be done; I'm making a map for an rts game. &quot;A&quot; to &quot;H&quot; are each a starting position for a player to begin. But i want pairs of people for a 2v2v2v2 scenario. So A and B need to stick together. I'm very noob to JS and its probably an obvious mistake. The script runs without errors.</p>