Skip to content

Commit 1f01e08

Browse files
author
programmiri
committed
Add second solution
1 parent 9d65120 commit 1f01e08

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

difference-of-squares/difference-of-squares.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export class Squares {
66
get sumOfSquares() {
77
let count = 0;
88
for (let i = 1; i <= this.number; i++ ) {
9-
count += i * i
9+
count += Math.pow(i, 2)
1010
}
1111
return count;
1212
}
@@ -16,7 +16,7 @@ export class Squares {
1616
for (let i = 1; i <= this.number; i++ ) {
1717
count += i
1818
}
19-
return count * count;
19+
return Math.pow(count, 2)
2020
}
2121

2222
get difference() {

0 commit comments

Comments
 (0)