How do you write a program that calculate factorial in javascript?

JavaScript

1 answer

Answer

1183361

2026-05-16 04:01

+ Follow

function factorial(n)

{

var x=1;

while(n>1)

x*=(n--);

return x;

}

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.