title: Javascript Loop through and Concatenate 2 arrays
body: <p>I am trying to loop through and concatenate 2 arrays such as below, I don’t know how many values there will be as a user could purchase 1 or 100 products so it needs to loop.</p>
  
  <pre><code>Array1 = ['ABC', 'DEF', 'GHI']
  
  Array2 = ['123', '45', '6789',]
  </code></pre>
  
  <p>I need to output to be:</p>
  
  <pre><code>ABC:123|DEF:45|GHI:6789
  </code></pre>
  
  <p>Currently code I have...</p>
  
  <pre><code>function() {
    var array_one = ['ABC', 'DEF', 'GHI', 'JKL'];
    var array_two = ['179.99', '349.99', '399.99', '389'];
    for (var i = 0; i &lt; array_one.length; i++) {
      for (var j = 0; j &lt; array_two.length; j++) {
        return(array_one[i] + ":" + array_two[j] + "|");
      }
    }
  }
  </code></pre>
  
  <p>This only outputs one value and doesn't loop through, any ideas where my loop is breaking. </p>