Salve ho questo esercizio in cui devo convertire codice Java in codice JavaScript:
public Class Employee {
public String name;
public String dept;
public Employee () {
this.name = "";
this.dept = "general";
}
}
public class SalesPerson extends WorkerBee {
public double quota;
public SalesPerson() {
this.dept = "sales";
this.quota = 100.0;
}
}
l'ho trasformato in tal modo ma non so se va bene:
function Employee (name, dept) {
function Employee () {
this.name = "";
this.dept = "general";
}
}
function WorkerBee(quota) {
function SalesPerson() {
this.dept = "sales";
this.quota = 100.0;
}
}
WorkerBee.prototype = Object.create(Employee.prototype);
Potete aiutarmi?