File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ const TEMPLATE = {
77 Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure.` ,
88 when : `you have to define steps of the algorithm once and let subclasses to implement its behaviour` ,
99 codeES5 : `function Tax() {}
10-
1110Tax.prototype.calc = function(value) {
1211 if (value >= 1000) value = this.overThousand(value);
1312
@@ -19,16 +18,16 @@ Tax.prototype.complementaryFee = function(value) {
1918};
2019
2120function Tax1() {}
22- Tax1.prototype = Object.create(Tax.prototype);
21+ Tax1.prototype = Object.create(Tax.prototype);
2322
24- Tax1.prototype.overThousand = function(value) {
23+ Tax1.prototype.overThousand = function(value) {
2524 return value * 1.1;
2625};
2726
2827function Tax2() {}
29- Tax2.prototype = Object.create(Tax.prototype);
28+ Tax2.prototype = Object.create(Tax.prototype);
3029
31- Tax2.prototype.overThousand = function(value) {
30+ Tax2.prototype.overThousand = function(value) {
3231 return value * 1.2;
3332};
3433
Original file line number Diff line number Diff line change @@ -20,12 +20,12 @@ function pilotDroidPattern() {
2020}
2121
2222function B1() {}
23- B1.prototype.info = function() {
23+ B1.prototype.info = function() {
2424 return 'B1, Battle Droid';
2525};
2626
2727function Rx24() {}
28- Rx24.prototype.info = function() {
28+ Rx24.prototype.info = function() {
2929 return 'Rx24, Pilot Droid';
3030};
3131
You can’t perform that action at this time.
0 commit comments