so on the factorial a number challenge i was stuck for a little bit but heres my solution, im fairly sure this is not how its meant to be done but hey it worked definitely looking for same advice to make this better.

```
var facArr=[];
while(num>=1){
facArr.push(num);
if(num>1){
num--;}else{break;}
}
if(num!=0){
for(i=0;i<facArr.length;i++){
num *=facArr[i];
}
}else{
num=1;
}
```