Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Factorial

Instructions

Given positive integer n implement a function, which returns a factorial of that integer. Factorial (of positive integer) is number that is created by multiplying all numbers from 1 to n eg. factorial of 3 (3!) is equal to 6 (3 * 2 * 1)

Challenge | Solution

Examples

factorial(1) // 1

factorial(2) // 2

factorial(3) // 6