hello,
i’m doing the factorial exercice and my code is different from the official solution but return the correct value.
Did i miss something?
const factorial = number => {
for (i = number - 1; i > 1; i–) {
number = number * i
}
return number
}
console.log(factorial(6))
// return 720
thanks for you help.