title: Javascript size on binary search tree
body: <p>I have done this is c++ because you can pass in a parameter by reference.  I am having trouble figuring out how to do this in JavaScript.  What do I need to change in my code? My output is 1</p>
  
  <pre><code>this.sizeOfBst = function(){
      size = 0;
  
      return sizeHelper(this.root, size);
  }
  
  function sizeHelper(node, size){
      if(node){
          sizeHelper(node.left, size);
          size++;
          sizeHelper(node.right, size);
      }
      return size
  }
  </code></pre>