title: JavaScript How to replace first element of an array with each element of another array
body: <p>I have two arrays and I need to replace the first element of the first array with each elements of the second array: </p>
  
  <pre><code>let firstArray = [
    [1, 'a', 'hello'],
    [2, 'b', 'world'],
    [3, 'c', 'other'],
    ...
  ];
  
  let secondArray = [1, 3, 7, ...];
  
  // Result: 
  // [
  //  [1, 'a', 'hello'],
  //  [3, 'b', 'world'],
  //  [7, 'c', 'other'],
  //  ...
  // ] 
  </code></pre>
  
  <p>I tried doing something like this:</p>
  
  <pre><code>firstArray.map(f =&gt; {
    secondArray.forEach(s =&gt; {
        f.splice(0, 1, s);
    })
  })
  </code></pre>
  
  <p>But this replace the first element only with the last element of second array</p>