#JavaScript (ES6), <s>33</s> <s>28</s> 23 bytes <!-- language-all: lang-js --> (n,x=n)=>--x?n*f(n,x):n Add 7 bytes if we need to allow for negative integers. (n,x=n>0?n:-n)=>--x?n*f(n,x):n And add 3 bytes if `0` should be output for input `0` (n,x=n>0?n:-n)=>n&&--x?n*f(n,x):n --- ##Try It <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-js --> f= (n,x=n)=>--x?n*f(n,x):n o.innerText=f(i.value=3) i.oninput=_=>o.innerText=f(+i.value) <!-- language: lang-html --> <input id=i min=0 type=number><pre id=o> <!-- end snippet --> --- ##History ###28 bytes n=>eval(1+("*"+n).repeat(n)) ###33 bytes n=>eval(Array(n).fill(n).join`*`)