You are viewing a single comment's thread. Return to all comments →
^ This
Here's my iterative solution using bignumber.js
const bigFactorial = n => { const bigNumber = require('bignumber.js'); let result = new bigNumber(1); for (let i = 1; i <= n; i++) { result = result.mul(i); } return result.toFixed(); } console.log(bigFactorial(n));
Seems like cookies are disabled on this browser, please enable them to open this website
Extra Long Factorials
You are viewing a single comment's thread. Return to all comments →
^ This
Here's my iterative solution using bignumber.js