title: Adding elements from each sub array in a 2D array in Javascript
body: <p>So I have this 2D permutations array of ints which looks like this:</p>
  <pre class="lang-js prettyprint-override"><code>arr = [
    [ 5, 2, 6 ],
    [ 2, 5, 6 ],
    [ 6, 5, 2 ],
    [ 5, 6, 2 ],
    [ 2, 6, 5 ],
    [ 6, 2, 5 ]
  ]
  </code></pre>
  <p>and essentially I want to be able to get a <strong>string</strong> that looks like this '652,625,562,526,256'</p>
  <p>This means that the numbers are ordered and are in string format.</p>
  <p>What I have done so far is:</p>
  <pre class="lang-js prettyprint-override"><code>arr.map(c =&gt; c.join(&quot;&quot;)).join()
  </code></pre>
  <p>Which combines it to a array, however now my thought process would be to convert this to a array of ints and then order and re-parse as strings, but there must be some kind of easier way to do this?</p>
  <p>I'm quite new to JavaScript so any help is appreciated.</p>