Fix factorial

This commit is contained in:
Mahdi Dibaiee 2020-06-09 14:56:24 +01:00 committed by GitHub
parent e53115b75c
commit db3ec53031
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,7 +53,7 @@ export default {
'!': {
fn: (a) => {
let sum = 1;
for (var i = 0; i < a; ++i) {
for (var i = 1; i <= a; ++i) {
sum *= i;
}
return sum;