Skip to content

Commit da322ae

Browse files
committed
Fix description to make it easier to understand
1 parent d33c3f7 commit da322ae

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sum-of-power-digits/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function calculateSumOfAllDigits(number, power) {
2525
for (let i = 0; i < numberString.length; i++) {
2626
//repeat for each digit
2727
const digit = parseInt(numberString[i], 10); //convert string to integer
28-
sum += digit ** power; //get power of digit then add digit to sum
28+
sum += digit ** power; //get power root of digit then add digit to sum
2929
}
3030
return sum; //return sum of all digits
3131
}
@@ -40,7 +40,7 @@ function calculateSumOfIntegerDigits(number, power) {
4040
for (let i = 0; i < integerString.length; i++) {
4141
//repeat for each digit
4242
const digit = parseInt(integerString[i], 10); //convert string to integer
43-
sum += digit ** power; //get power of digit then add digit to sum
43+
sum += digit ** power; //get power root of digit then add digit to sum
4444
}
4545
return sum; //return sum of integer digits
4646
}

sum-of-power-digits/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<!doctype html>
22
<html lang="en">
33
<head>
4-
<title>Sum of Power of Digits Calculator</title>
4+
<title>Sum of Power Root of Digits Calculator</title>
55
</head>
66
<body>
7-
<h1>Sum of Power of Digits Calculator</h1>
7+
<h1>Sum of Power Root of Digits Calculator</h1>
88
<input type="number" id="numberInput" />
99
Power: <input type="number" min="1" step="1" id="powerInput" />
1010
<select id="option">

0 commit comments

Comments
 (0)