Skip to content

Commit eda5940

Browse files
committed
make healthLevel an instance variable at Score
1 parent 10aa4f7 commit eda5940

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ export class Scorer {
1111

1212
execute() {
1313
this._result = 0;
14-
let healthLevel = 0;
14+
this._healthLevel = 0;
1515
let highMedicalRiskFlag = false;
1616

1717
if (this._medicalExam.isSmoker) {
18-
healthLevel += 10;
18+
this._healthLevel += 10;
1919
highMedicalRiskFlag = true;
2020
}
2121

@@ -26,7 +26,7 @@ export class Scorer {
2626
}
2727

2828
// lots more code like this
29-
this._result -= Math.max(healthLevel - 5, 0);
29+
this._result -= Math.max(this._healthLevel - 5, 0);
3030

3131
return this._result;
3232
}

0 commit comments

Comments
 (0)