Do minor optimisations to factorial function.

This commit is contained in:
Oleksii Trekhleb 2018-06-02 09:40:32 +03:00
parent 88bd8d7044
commit 924066bb0c

View File

@ -5,7 +5,7 @@
export default function factorial(number) {
let result = 1;
for (let i = 1; i <= number; i += 1) {
for (let i = 2; i <= number; i += 1) {
result *= i;
}