Below I have two member functions, sayHello and sayHi, that effectively do the same thing:
function Person (n) {
this.name = n;
this.sayHello = function() {console.log("Hello, my name is "+this.name);};
};
Person.prototype.sayHi = function() {console.log("Hi, I'm "+this.name);};
Jeff = new Person('Jeff');
Joe = new Person('Joe');
Jeff.sayHello() // returns "Hello, my name is Jeff"
Joe.sayHi() /// returns "Hi, I'm Joe"