title: Javascript nested array to integer
body: <p>I have a nested array</p>
  <pre><code>const folder = [1, [2, [3, [4, [5, [6]]]]]];
  </code></pre>
  <p>please use the basic concept of javaScript.
  I need return like 123456. what should I do?
  i tried using for loops but it didn't work.</p>