Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Person(name) {
- this.name = name;
- }
- Person.prototype.getName = function(){
- return this.name;
- };
- function User(name, password) {
- this.name = name;
- this.password = password;
- }
- User.prototype = new Person();
- User.prototype.getPassword = function(){
- return this.password;
- };
- var user = new User('KEN', 'backdrop');
- console.log(user.getName(), user.getPassword());
Add Comment
Please, Sign In to add comment