title: Issue with JavaScript Recursion
body: <p>I'm trying to write a recursive method which may take a <code>array/value</code> as input and then process the input.</p>
  
  <pre><code>&lt;html&gt;
    &lt;body&gt;
      &lt;script&gt;
        function process(array){
          if (array instanceof Array) {
            for(i=0; i &lt; array.length; i++){
              process(array[i]);
            }
          } else {
            document.write(array + "&lt;br /&gt;");
          }
        }
  
        process([3, 4, 5, [4,1], [5,1,2],[6,1]]);
      &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When I try to run this program, It seems like going to an infinite loop. Why is it? </p>