Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Person(firstname, lastname){
- this.firstname = firstname,
- this.lastname = lastname
- }
- Person.prototype.getFullName = function(){
- return this.firstname + ' ' + this.lastname;
- }
- var john = new Person("John", "Doe");
- var jane = new Person("Jane", "Doe");
- console.log(john.getFullName());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement