Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

function prototype javascript

function Person(name) {
  this.name = name;
}
Person.prototype.getName = function() {
  return this.name;
}

var person = new Person("John Doe");
person.getName() //"John Doe"
 
PREVIOUS NEXT
Tagged: #function #prototype #javascript
ADD COMMENT
Topic
Name
2+1 =