Question: I'm learning javascript. I have written a none recursive function which I want to return the factorial of a given number.

```
function factorialize(n) {
  for(var i = 0; i < n; i++) {
     n *= i;
  }
  return n;
}

factorialize(5);

```

so result should be `120`

I keep getting `0`

Answer: 
With your code:

* loop1: n = 5 \* 0 | n = 0
* loop2: n = 0 \* 1 | n = 0
* loop3: n = 0 \* 2 | n = 0
* loop4: n = 0 \* 3 | n = 0
* loop5: n = 0 \* 4 | n = 0

and then you return 0

"**i**" must start from 1, otherwise, in every loop you multiply by 0.

I don't provide a solution, because you have already received a lot of correct answers.
You are actually doing this

n = (5 \* 0 \* 1 \* 2\* 3 \* 4 \* 5 \* 6)