To clarify the other answers; there is a difference between the function declaration, an instance created by the function and a function's prototype. I hope the following code will demonstrate that:
//declararion:
function Person(name){
this.name=name
}
// sayName is a method of a person instance like jon.sayName
Person.prototype.sayName=function(){
console.log("Hi, I'm "+Person.formatName(this.name));
};
// static property of Person to format name
Person.formatName=function(name){
return name.toLowerCase().replace(/\b\w/g,function(){
return arguments[0].toUpperCase();
});
};
// now we create an instance of person
var jon = new Person("jon holt");
jon.sayName();//=Hi, I'm Jon Holt
// next line's output:
//["prototype", "formatName", "length", "name", "arguments", "caller"]
console.log(Object.getOwnPropertyNames(Person));
// name in Person isn't the same as name in jon
console.log(Person.name);//=Person
// next line's output: ["name"], name here would be jon holt
console.log(Object.getOwnPropertyNames(jon));
// next line's output: ["constructor", "sayName"]
console.log(Object.getOwnPropertyNames(Person.prototype));
Here is a link to some ways to use function constructors, prototype and inheritance: Prototypical inheritance - writing up