Easy10 min

Calculate a Factorial

Return the factorial of a nonnegative integer. The factorial of zero is one.

Your function

Implement solve(value, extra) in JavaScript. Return the answer; printing alone does not count as a result.

Examples

Input: [0]
Output: 1
Input: [1]
Output: 1

Constraints

0 ≤ value ≤ 12

13px
main.jsYour ideas, in code.
Loading your editor…
Run your code to see the output here.
Ready to buildUTF-84 lines

Test freely without an account. Signed-in submissions are checked independently by the isolated execution service before progress is awarded.