Skip to content

Commit 924066b

Browse files
committed
Do minor optimisations to factorial function.
1 parent 88bd8d7 commit 924066b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/algorithms/math/factorial/factorial.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
exportdefaultfunctionfactorial(number){
66
letresult=1;
77

8-
for(leti=1;i<=number;i+=1){
8+
for(leti=2;i<=number;i+=1){
99
result*=i;
1010
}
1111

0 commit comments

Comments
(0)