Toggle Menu
Coding Platform
Toggle theme
Code Editor
// JavaScript: Find the factorial of a number function factorial(n) { if (n === 0) { return 1; } return n * factorial(n - 1); } console.log(factorial(5));
Run Code
Output
Click "Run Code" to see the output here.