JSFiddle - React, Tailwind, and code Playground

by WK_of_Angmar

JavaScript

function fact(x) {
    if (x <= 0) return x;
    else return x * fact(x - 1);
};

document.write(fact(4));