mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-06-05 15:09:09 +09:00
Calculator Factorial: Remove redundant guard clause (#499)
This commit is contained in:
@@ -19,7 +19,6 @@ const power = function (a, b) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const factorial = function (n) {
|
const factorial = function (n) {
|
||||||
if (n === 0) return 1;
|
|
||||||
let product = 1;
|
let product = 1;
|
||||||
for (let i = n; i > 0; i--) {
|
for (let i = n; i > 0; i--) {
|
||||||
product *= i;
|
product *= i;
|
||||||
|
|||||||
Reference in New Issue
Block a user