Factorial Challenge: Correct, but doesn't register?
See original GitHub issueChallenge Factorialize a Number has an issue.
User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36
.
Please describe how to reproduce this issue, and include links to screenshots if possible.
My code:
var total = 1;
function factorialize(num) {
for (var i=0; i<num; i++){
total = total * (num - i);
}
return total;
}
factorialize(5);
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Why won't factorial(100) work? - Codecademy
Out of curiosity (I wanna know whether the program will be fast enough to calculate something big), I just accidentally put 100 for...
Read more >Extra long factorial challenge giving me different result in ...
I've tried putting "BigInt" before my result but that gives me something like "15511210043330985984000000n" this "n" at the end of every number.
Read more >The factorial function (article) | Khan Academy
The factorial function is defined for all positive integers, along with 0. What value should 0! have? It's the product of all integers...
Read more >Simple Factorial Challenge - Code Golf Stack Exchange
Given an integer n where 0 <= n <= 420, find the sum of the digits of n!. It's that simple :P. Notes:...
Read more >Incredible Factorial Problem! - YouTube
This was the hardest problem in the 2002-3 British Mathematical Olympiad. Thanks to Nahian for the suggestion!British Mathematical Olympiad ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@LonePoop You just need to declare the ‘total’ variable inside the function scope.
function factorialize(num) { var total = 1; for (var i=0; i<num; i++){ total = total * (num - i); } return total; } factorialize(5);
Duplicate of #9199