You are viewing a single comment's thread. Return to all comments →
function factorial(n) { let countDown = n; let result = 1;
while (countDown > 0) { result *= countDown; countDown--; } return result; }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 1: Functions
You are viewing a single comment's thread. Return to all comments →
function factorial(n) { let countDown = n; let result = 1;
while (countDown > 0) { result *= countDown; countDown--; } return result; }