7 lines
139 B
JavaScript
7 lines
139 B
JavaScript
|
function factorial(number){
|
||
|
if (number == 1){
|
||
|
return 1;
|
||
|
}
|
||
|
return number * factorial(number - 1);
|
||
|
};
|
||
|
export {factorial};
|