function factorialize(num) {
let value;
let newArr = [];
let factorial;
for(let i = 1;i<=num;i++){
//console.log(i);
factorial = num * (num-i) ;
console.log(factorial);
}
if(num === 0){
return 1;
}
return factorial;
}
console.log(factorialize(5));
Code so far,I facing problem with the looping of values in the factorial like ,
5! = 5 * 4 * 3 * 2 * 1,which should be standard for all the numbers.