Question: Functions and Factorials Create a function that finds the factorial of a number. Using Arrow Function. Functions and Factorials Finds the factorial of a number
Functions and Factorials
Create a function that finds the factorial of a number. Using Arrow Function.
Finds the factorial of a number
var numberFact = (x) => {
var x = document.getElementById("Please enter a number").value;
if (x == 0) {
return 1;
}
else {
return x * numberFact(x-1);
}
}
document.getElementById("determine number").innerHTML = numberFact();
This is my code and it won't work. Can't figure that out my self.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
