Skip to content

Latest commit

 

History

History
20 lines (12 loc) · 460 Bytes

File metadata and controls

20 lines (12 loc) · 460 Bytes

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