var User =function () {
  this.firstName = '';
  this.lastName = '';

  this.getFirstName = function(){
    return this.username;
  }
  this.getLastName = function(){
    return this.password;
  }
  this.setFirstName = function(firstName){
    this.firstName=firstName;
  }
  this.setLastName = function(lastName){
    this.lastName=lastName;
  }
}

User.prototype.getFullname = function() {
  return this.firstName+' '+this.lastName;
}

class UserES6 {

  firstName = '';
  lastName = '';
  username = '';
  password = '';

  getUsername = function(){
    return this.username;
  }
  getPassword = function(){
    return this.password;
  }
  setUsername = function(username){
    this.username = username;
  }
  setPassword = function(password){
    return this.password = password;
  }
}

var User2 = new UserES6();
User2.setUsername('Adam');
console.log(User2.getUsername());

var LoginUser = function (){

  User.call(this);

  this.username = '';
  this.password = '';

  this.getUsername = function(){
    return this.username;
  }
  this.getPassword = function(){
    return this.password;
  }
  this.setUsername = function(username){
    this.username=username;
  }
  this.setPassword = function(password){
    return this.password=password;
  }
}

class LoginUserES6 extends User{

  constructor(){
    super();
    this.username = '';
    this.password = '';
  }

  getUsername(){
    return this._username
  }
  getPassword(){
    return this._password
  }
  setUsername(usernaxme){
    this.username=usernaxme
  }
  setPassword(passwsord){
    this.password=passwsord;
  }
}

const User3 = new LoginUserES6();

User3.username='admin';
console.log(User3);

LoginUser.prototype = Object.create(User.prototype)
//LoginUser.prototype.constructor = LoginUser;

var user = new User();
console.log(user)
var User1 = new LoginUserES6();
User1.setFirstName('john')
User1.setLastName('dae')
User1.setUsername('johndae');
console.log('Fullname : '+User1.getFullname())