We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Day 1: Functions
Day 1: Functions
Sort by
recency
|
295 Discussions
|
Please Login in order to post a comment
function factorial(n) { let countDown = n; let result = 1;
while (countDown > 0) { result *= countDown; countDown--; } return result; }
function factorial(n){ let result = 1 for(let i=1;i<=n;i++){ result=i*result // yfy } return result; }