javascript return factorial of number code example
Example: factorial javascript
// Simple arrow function solution
var factorial = n => (n <= 0) ? 1: n * factorial(n - 1);
// Simple arrow function solution
var factorial = n => (n <= 0) ? 1: n * factorial(n - 1);