mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-06-05 15:09:09 +09:00
feat(08): remove recursive solution (#457)
Not appropriate to expose learners to at this point in the curriculum
This commit is contained in:
@@ -27,15 +27,6 @@ const factorial = function (n) {
|
|||||||
return product;
|
return product;
|
||||||
};
|
};
|
||||||
|
|
||||||
// This is another implementation of Factorial that uses recursion
|
|
||||||
// THANKS to @ThirtyThreeB!
|
|
||||||
const recursiveFactorial = function (n) {
|
|
||||||
if (n === 0) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return n * recursiveFactorial(n - 1);
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
add,
|
add,
|
||||||
subtract,
|
subtract,
|
||||||
|
|||||||
Reference in New Issue
Block a user