var res = Fact(4); function Fact(N) { if(N == 0 || N == 1) { return 1; } else { return N * Fact(N-1); } } console.log(res);
To embed this program on your website, copy the following code and paste it into your website's HTML: