4. Factorial
Lesson 5 of 31 in Coddy's 30 Days of Logic Building in Javascript course.
Challenge
EasyWrite a function to calculate the factorial of a given number.
- Input:
<strong>5</strong> - Output:
<strong>120</strong>
Try it yourself
function factorial(n) {
// write your code below
}All lessons in 30 Days of Logic Building in Javascript
1Introduction
What is here for you?