What's happening
function StaffMember(name){ this.name = name; this.total = 0; this.discountPercent = function(){
This creates a constructor function and adds another function to its prototype. If you then call new StaffMember("bob") , it will create an object with the local property name set to bob , the total value of the local property is 0, the local discountPercent function and the static function calculateTax
var StaffMember = function(name){ this.name = name; this.discountPercent = function(){
This is equivalent to the above, except for the full property. Note that you have not yet created an instance of this StaffMember object, which I think you are trying to create. You just defined functon and put another function on your prototype
var StaffMember { name:"", discountPercent:function(){
This syntax is not valid, you need = after StaffMember, but otherwise it will create an object with the name, discount, and calculateTax parameters.
This object will actually exist, since you created it directly, for others you will need to call var something = new StaffMember() .
Differences
There is no significant difference between 1 and 2, except for those where these things are defined in the function (the first example will be raised to the top of the current scope, the second example will not be set to this point in the code).
As soon as you call new StaffMember() , there will be some differences between the created object and the object that you create directly in the third example.
The most significant is that the prototype object will be used together with the objects instead of creating a new one when creating a new object. This is not very important, since you just turned on the function, so the actual performance will be the same, but it will save some memory, and it will act differently if you put the object in an array on the prototype.