bradxr
8/5/2018 - 8:08 AM

Factorialize a Number

Example - 5! = 1 * 2 * 3 * 4 * 5 = 120

function factorialize(num) {
  let result = 1;

  for (let i = 1; i <= num; i++) {
    result *= i;
  }

  return result;
}

factorialize(5);      // 120