Factorial with JavaScript