Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript factorial

function factorial(n) {
  if (n < 0) return;
  if (n < 2) return 1;
  return n * factorial(n - 1);
}
 
PREVIOUS NEXT
Tagged: #javascript #factorial
ADD COMMENT
Topic
Name
8+1 =