factorial

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
loop
var j = 0;

for (var i=1; i<100; i++){
j *= i;
}

alert(j);
ready
recursion
var fact = function(i){
if(i == 1){
return 1;
} else {
return i*fact(i-1);
}
};

alert(fact(100));
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.