Write a “person” class to hold all the details.
class person{ constructor(name,age){ this.name=name; this.age=age; } } var c1=new person("jon",23); var c2=new person("doe",25);
write a class to calculate uber price.
class uberPrice{ constructor(perkm,distance){ this.perkm=perkm; this.distance=distance; } get calcUberprice(){ return this.calcalcUberprice(); } calcalcUberprice(){ return this.perkm * this.distance; } } var c1=new uberPrice(20,23); console.log(c1.calcUberprice);