moringaman
10/1/2016 - 6:17 PM

Factorialize a number

Factorialize a number

function factorialize(num) {
  
  var i;
  var n = 1;
  
  for (i=1; i<=num; i++ ){  
    n*=i;  
    console.log(n);
  }
  
  num = n;
  return num;
}

factorialize(5);