Created
April 13, 2018 03:31
-
-
Save mohanadkaleia/3b23f5046789497ffee77cabc1ae07a4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User { | |
constructor(name) { | |
this.name = name; | |
} | |
sayHi() { | |
console.log(`Hi, ${this.name}`); | |
} | |
} | |
class Admin extends User { | |
constructor(name) { | |
super(name); | |
this.isAdmin = true; | |
} | |
} | |
let admin = new Admin('Mohanad'); | |
console.log(admin.isAdmin); // true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment