Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Mall {
- constructor(shopname) {
- this.shopname = shopname;
- }
- shopisPresent() {
- return this.shopname +
- ' is present in the ';
- }
- }
- class Shop extends Mall {
- constructor(name, mallname) {
- super(name);
- this.mallname = mallname;
- }
- showShop() {
- return this.shopisPresent() +
- this.mallname;
- }
- }
- class Kiosk extends Shop {
- constructor(name, mallname) {
- super(name, mallname);
- }
- shopisPresent() {
- return super.shopisPresent() +
- this.mallname + ", pss";
- }
- }
- let newMall = new Shop(
- "Domino", "Select City Walk Mall"
- );
- let newKiosk = new Kiosk(
- "Domino", "Select City Walk Mall"
- );
- console.log(newMall.showShop());
- console.log(newKiosk.shopisPresent());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement