Factorial of a number

PHOTO EMBED

Sun May 08 2022 04:29:55 GMT+0000 (Coordinated Universal Time)

Saved by @anjalisingh007a

const factorial = function fac(n) { return n < 2 ? 1 : n * fac(n - 1) }

console.log(factorial(3))
content_copyCOPY

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions