Question: Write a code using JavaScript to create a recursive function called myFactorial, that has one parameter: A factorial is the product of an integer and

Write a code using JavaScript to create a recursive function called myFactorial, that has one parameter:

A factorial is the product of an integer and all the integers below it. Factorials are denoted as n! and 0! = 1.

So, 0! = 1, 1! = 1, 2! = 2, 3! = 6, and 4! =24.

Your application should produce the following results:

myFactorial output 0 to 10:

0! = 1 1! = 1 2! = 2 3! = 6 4! = 24 5! = 120 6! = 720 7! = 5,040 8! = 40,320 9! = 362,880 10! = 3,628,800

Use a for loop to call your function 11 times, use concatenation to put your output together, use the .toLocaleString() to put the comma into your results.

Remember, your function should call itself (recursion) to get full credit.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!