title: JS: TypeError: this._init is not a function. (In 'this._init()', 'this._init' is undefined)
body: <p>maybe you will find the problem. The console always says:</p>
  
  <p><strong>TypeError: this._init is not a function. (In 'this._init()', 'this._init' is undefined)</strong></p>
  
  <pre><code>nodes = [];
  for (var i = 0; i &lt; 3; i++) {
      var newNode = new Node(i*100,0);
      nodes.push(newNode);
  };
  
  function Node(posX, posY, parent) {
      if (typeof parent === 'undefined') { parent = 0; }
      this.parent = parent;
      this.children = [];
      this.text = "Node";
      this.posX = posX;
      this.posY = posY;
      this._init();
  
      this._init = function() {
          alert("test");
      }
  }
  </code></pre>