function fact(n) { if (n < 0) return null; if (n > 0) { return (n * fact(n-1)); } else { return 1; } }
takatoh's blog – Learning programming languages.
function fact(n) { if (n < 0) return null; if (n > 0) { return (n * fact(n-1)); } else { return 1; } }