Factorialize a Number - I don't see a bug

Factorialize a Number - I don't see a bug
0.0 0

#1

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);

#2

@akurumei don’t use a global variable.