Skip to content
Snippets Groups Projects
Commit 1469ba54 authored by ttran67's avatar ttran67
Browse files

Fixed d

parent 2612030f
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,10 @@ export function countDigits(positiveInteger) { ...@@ -4,7 +4,10 @@ export function countDigits(positiveInteger) {
// INSTRUCTIONS: Write a loop here that runs as long as `remainingDigits` is // INSTRUCTIONS: Write a loop here that runs as long as `remainingDigits` is
// still positive, and on each iteration increments result and updates // still positive, and on each iteration increments result and updates
// `remainingDigits` to `Math.floor(remainingDigits / 10)`. // `remainingDigits` to `Math.floor(remainingDigits / 10)`.
// while (remainingDigits > 0){
result++;
remainingDigits = Math.floor(remainingDigits / 10);
}
// Resources: // Resources:
// <https://javascript.info/while-for#the-while-loop> // <https://javascript.info/while-for#the-while-loop>
// <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/while> // <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/while>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment