Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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
export default function factorial(number) {
66
let result = 1;
77

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

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /