Relations between an object, its constructor and its methods
<p>this is #33 from John Resig`s Learning Advanced JavaScript. <a href="http://ejohn.org/apps/learn/#33" rel="nofollow">http://ejohn.org/apps/learn/#33</a>   Would appreciate as much help as you can provide on this.</p>

<p>1) technically speaking, is <code>ninja.changeName("Bob")</code>  "calling" the function Ninja, or does it go immediately to <code>this.changeName(name);</code> </p>

<p>2) Once <code>ninja.changeName("Bob")</code> is invoked, what is the order in which the processing events take place inside function Ninja(name)?  </p>

<p>3) what exactly is the purpose/function of    this.changeName ( name);</p>

<pre><code>function Ninja(name){
  this.changeName = function(name){
    this.name = name;
  };

  this.changeName( name );
}

var ninja = new Ninja("John");
assert( ninja.name == "John", "The name has been set on initialization" );

ninja.changeName("Bob");
assert( ninja.name == "Bob", "The name was successfully changed." );
</code></pre>
