Skip to content

Latest commit

 

History

History
12 lines (10 loc) · 156 Bytes

factorial.md

File metadata and controls

12 lines (10 loc) · 156 Bytes

Factorial

function factorial(n) {
    // base case (must have)
    if (n === 0) {
        return 1;
    }

    return n * factorial(n - 1);
};