Answers for "javacript inheritance"

3

javascript inheritance

class Animal {
   null
}
class tiger extends Animal {
 null }
Posted by: Guest on May-15-2021
0

Inheritance in JavaScript

class teamMember {
    name;
    designation = "Support web dev";
    address;
    constructor(name, address) {
        this.name = name;
        this.address = address;
    }
}

class Support extends teamMember {
    startSession() {
        console.log(this.name, "start a support sessin");
    }
}
class StudentCare extends teamMember {
    buildARoutine() {
        console.log(this.name, "build a routine");
    }
}

const max = new Support("Max", "USA");
console.log(max);
const sarah = new StudentCare("Sarah", "UK");
console.log(sarah);
Posted by: Guest on January-06-2022
1

javascript inheritance

class childClass extends parentClass
{
  
}
Posted by: Guest on September-02-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language