Skip to content

Commit

Permalink
fix: 工具函数 阶乘修复
Browse files Browse the repository at this point in the history
  • Loading branch information
Vivomo committed May 1, 2022
1 parent 7fa4e71 commit 68b23c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nodejs/util/MathUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const factorial = (n) => {
return 1;
}
let result = 1;
for (let i = 2; i < n; i++) {
for (let i = 2; i <= n; i++) {
result *= i;
}
return result;
Expand Down

0 comments on commit 68b23c3

Please sign in to comment.