Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

factorize a number

function factorialize(num, factorial = 1) {
  if (num === 0) {
    return factorial;
  } else {
    return factorialize(num - 1, factorial * num);
  }
}

factorialize(5);
Source by forum.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #factorize #number
ADD COMMENT
Topic
Name
9+2 =