Answers for "factorial of a number js"

1

javascript factorial of a number

const factorial = n => n <= 1 ? 1 : n * factorial(n - 1);

// Examples
factorial(2);   // 2
factorial(3);   // 6
Posted by: Guest on July-03-2020

Code answers related to "factorial of a number js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language