JSFiddle - React, Tailwind, and code Playground
by Nabaraj Saha
JavaScript
function User(name, email){
this.name = name;
this.email = email;
}
User.prototype.login=function(){
this.login=true;
console.log(this.email, this.login)
}
User.prototype.logOut=function(){
this.login=false;
console.log(this.email, this.login)
}
function Admin(...args){
console.log(args);
User.apply(this, args);
}
Admin.prototype = Object.create(User.prototype);
//Admin.prototype.constructor = Admin;
var admin = new Admin("nabaraj","[email protected]");
console.log("admin ",admin)
admin.login();