function Person(name) { this.name = name; } Person.prototype.getName = function() { return this.name; } var person = new Person("John Doe"); person.getName() //"John Doe"