factorial of a number in oneline javascript 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);