Factorial operation
Given a number, return the product of all positive numbers less than or equal to the given number.
Sample Code:
function factorialOp(num) {
// Enter your logic here...
}
Examples:
Input: 3
Output: 6
Explanation: 3*2*1 = 6.
Input: 0
Output: 1
Explanation: Factorial of 0 is 1. Why? Math said so.