How would I make a factorial calculator function?
Profile icon
RohilPatel

How would I make a factorial calculator function? I need that to make a permutations and combinations calculator. I am pretty sure you would need a loop of some sort, but I'm not sure how to do it. Thanks for the help!

You are viewing a single comment. View All
Profile icon
mwilki7

@RohilPatel

let product = 1; for (let i = 0; i < n; i++) { product *= i; }