-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathsuper.html
More file actions
executable file
·54 lines (40 loc) · 1001 Bytes
/
super.html
File metadata and controls
executable file
·54 lines (40 loc) · 1001 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html>
<head>
<title>gettersAndSetters.html</title>
</head>
<body>
<script>
"use strict";
class Tax{
constructor(income){
this.income = income;
}
calculateFederalTax(){
console.log(`Calculating federal tax for income ${this.income}`);
}
calcMinTax(){
console.log("In Tax. Calculating min tax");
return 123;
}
}
class NJTax extends Tax{
constructor(income, stateTaxPercent){
super(income);
this.stateTaxPercent=stateTaxPercent;
}
calculateStateTax(){
console.log(`Calculating state tax for income ${this.income}`);
}
calcMinTax(){
super.calcMinTax();
console.log("In NJTax. Adjusting min tax");
}
}
var theTax = new NJTax(50000, 6);
theTax.calculateFederalTax();
theTax.calculateStateTax();
theTax.calcMinTax();
</script>
</body>
</html>