Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- test with https://www.webtoolkitonline.com/javascript-tester.html -->
- const fn = (n) => {
- const fnT = (n, a) => n <= 1 ? a : fnT(n - 1, n * a);
- return fnT(n, 1)
- };
- alert(fn(4))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement