javascript objects are these all the same
<p>What is the difference with the code below  </p>

<p>1) are the first two constructors the same just with a different scope?</p>

<p>2) is the third object the same as the first two if they where instantiated as objects?</p>

<p>thanks for your help?</p>

<pre><code>   function StaffMember(name){
        this.name = name;
        this.total = 0;
        this.discountPercent = function(){
            //do stuff
        };
    }

    StaffMember.prototype.calculateTax = function(){
    //work out tax

    };
</code></pre>

<p>or</p>

<pre><code>var StaffMember = function(name){
    this.name = name;
    this.discountPercent = function(){
            //do stuff
    };
}

StaffMember.prototype.calculateTax = function(){
//work out tax

};
</code></pre>

<p>or</p>

<pre><code>var StaffMember {
    name:"",
    discountPercent:function(){
            //do stuff
    },
    calculateTax : function(){
                     //work out tax

    }
}
</code></pre>
