{"ScriptPreparationCode":"function factorializeRecursive(num) {\r\n if (num \u003C 0) \r\n return -1;\r\n else if (num == 0) \r\n return 1;\r\n else {\r\n return (num * factorializeRecursive(num - 1));\r\n }\r\n}\r\n\r\n\r\nfunction factorializeLoop(num) {\r\n var result = num;\r\n if (num === 0 || num === 1) \r\n return 1; \r\n while (num \u003E 1) { \r\n num--;\r\n result *= num;\r\n }\r\n return result;\r\n}","TestCases":[{"Name":"Finding factorial using loop","Code":"var r = factorializeLoop(20);","IsDeferred":false},{"Name":"Finding factorial using recursion","Code":"var r = factorializeRecursive(20);","IsDeferred":false}]}