function myCustomFunction(n) { var a = 1; while (n > 0) { a = a * n; n--; } return a; }