title: Is it possible to implement arrayToList function in JS not from stepping through the array backwards?
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function arrayToList(array) {
    var list = null;
    for (var i = array.length - 1; i &gt;= 0; i--) //How to implement it if i = 0?
      list = {
        value: array[i],
        rest: list
      };
    return list;
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>arr.reverse - not offer. I'm curious how it can be done if we're stepping through the array from array[0]? Or this task in JS only can be done if we're stepping through the array backwards? </p>