Skip to content

Commit de12e18

Browse files
authored
result *= num
1 parent a6767ba commit de12e18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Maths/WhileLoopFactorial.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const factorialize = (num) => {
66
let result = 1
77
// Step 2. WHILE loop
88
while (num > 1) {
9-
result = result * num // or result = result * num;
9+
result *= num // or result = result * num;
1010
num-- // decrement 1 at each iteration
1111
}
1212
// Step 3. Return the factorial

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy