Factorialize a Number - I don't see a bug

Hello, my function returns correct answers, but i still don’t receive points. Maybe somebody can see bug cause i can’t (╯°□°)╯︵ ┻━┻, here is my code:

counter = 1;
function factorialize(num) {
  for (var i = 1; i <= num; i++) {
    counter = counter * i;
  }
  num = counter;
  return num;
}

factorialize(5);

@akurumei don’t use a global variable.

1 Like