Guest User

Untitled

a guest
Dec 2nd, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. function Person(name) {
  2. this.name = name;
  3. }
  4.  
  5. Person.prototype.getName = function(){
  6. return this.name;
  7. };
  8.  
  9. function User(name, password) {
  10. this.name = name;
  11. this.password = password;
  12. }
  13.  
  14. User.prototype = new Person();
  15.  
  16. User.prototype.getPassword = function(){
  17. return this.password;
  18. };
  19.  
  20. var user = new User('KEN', 'backdrop');
  21.  
  22. console.log(user.getName(), user.getPassword());
Add Comment
Please, Sign In to add comment