title: JavaScript console.log execution order?
body: <p>I have code that looks something like this:</p>
  
  <pre><code>function pathfind (start,end,map)
  {
      this.Init = function ()
      {
         this.open_node = new Array();
         this.open_node.push(start);
         console.log(this.open_node);
         this.Loop();
      }
      this.Loop = function ()
      {
         //Some code here
      }
      this.Init();
  }
  </code></pre>
  
  <p>For some reason when I push "start" to this.open_node and I log its value, I get "undefined". However, after some bug testing I realized that commenting out this.Loop(); in this.Init causes push to function properly and console.log to return [start] as it should. Can anyone explain why on earth this behavior would occur? </p>
  
  <p>EDIT: I'm calling </p>
  
  <pre><code>pathfind({x:2,y:2},{x:24,y:24},parsemap(25,25));
  </code></pre>