Factorial

In mathematics, the factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n.

Create a recursive function factorial(n) that calculates the factorial of n.

Reverse a string

Create a recursive function reverseString(str) that gives you the reverse of a string str.

For example, reverseString("lorem ipsum") would give you "muspi merol".

Sum elements in an array

Create a recursive function sumArray(arr) that takes an array of numbers and returns their total.

For example, sumArray[4, 30, 2] would give you 36.