Factorialize a Number helpp

whats wrong in my code

Your code so far

function factorialize(num) {
if (num == 0 || num == 1){
  num = 1;
for (var i = num - 1;i>=1;i--){
return num;


Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36.

Link to the challenge:

It the test case of factorialize(5), your current code starts i = 4, then i =3, then i=2, then i = 1. Why did you not include 5?

because num = 5 from before so 5*4 then 3 2 1

Your code isn’t wrong (except it is little annoying to read). Perhaps, reset and re-run the test?

Sorry about that. I thought there was a problem, but realize now that your code does produce the correct result.