55106-Typescript Javascript's Superset Solution
55106-Typescript Javascript's Superset Solution
function
arrLength(inputArray:any[]) {
var length = inputArray.length;
return length;
}
class Human {
protected name: string;
protected age: number;
constructor(name: string, age : number) {
this.name= name;
this.age = age;
}
}
class Employee extends Human {
protected department: string;
protected batch:string;
protected role:string;
constructor(name:string, age: number, department: string,
batch:string, role:string) {
super(name,age);
this.department = department;
this.batch=batch;
this.role=role;
}
getInfo(){
class Automobile {
protected fuelType: string;
protected price: number;
constructor(fuelType:string, price: number) {
this.fuelType= fuelType;
this.price= price;
}
doPrint():void {
console.log("I am automobile")
}
}
class Restaurant {
menu: any[];
constructor(menu: any[]) {
this.menu = menu;
}
list() {
console.log(this.menu);
}
}