**Tell us what’s happening:**

I pass the test but I am thinking a more efficient way to factorization. without the if (x == -1) to handle the 0 case.

**Your code so far**

```
function factorialize(num) {
var x = num-1;
if(x == -1){
return 1;
}
while(x > 0){
num *= x
x--;
}
return num;
}
factorialize(5);
```

**Your browser information:**

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

.

**Link to the challenge:**

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/factorialize-a-number