Skip to content

Commit a6f1c00

Browse files
committed
fix: lesson_06 converted function into a const
1 parent ec82617 commit a6f1c00

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lesson_06/expression/src/expression_calculator.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ export class ExpressionCalculator {
33
calculate(a: number, b: number, c: number, d: number, e: number): number {
44
// Implement your code here to return the correct value.
55

6-
return this.divide(this.multiply(this.add(a, b), c), this.pow(d, e));
6+
const ab = this.add(a, b);
7+
const abc = this.multiply(ab, c);
8+
const de = this.pow(d, e);
9+
const answer = this.divide(abc, de);
10+
return answer;
711
}
812

913
add(a: number, b: number): number {
@@ -22,7 +26,6 @@ export class ExpressionCalculator {
2226
return Math.pow(base, exponent);
2327
}
2428
}
25-
2629
/* onst add = a + b;
2730
const multiply = add * c;
2831
const divide = multiply / this.pow(d, e);*/

0 commit comments

Comments
 (0)