{"ScriptPreparationCode":" var nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\r\n \r\n function sum_recurse(arr, i=0, acc=0) {\r\n if (i \u003E arr.length)\r\n return acc;\r\n acc \u002B= i[i]; \r\n return sum_recurse(arr, i \u002B 1, acc);\r\n }\r\n \r\n function sum_while(arr) {\r\n var total = 0,\r\n i = 0,\r\n len = arr.length;\r\n \r\n while (i \u003C len) {\r\n total \u002B= arr[i\u002B\u002B];\r\n }\r\n \r\n return total;\r\n }\r\n \r\n function sum_for(arr) {\r\n var total = 0,\r\n len = arr.length;\r\n \r\n for (var i = 0; i \u003C len; i\u002B\u002B) {\r\n total \u002B= arr[i];\r\n }\r\n \r\n return total;\r\n }","TestCases":[{"Name":"recursion","Code":"sum_recurse(nums)","IsDeferred":false},{"Name":"while loop","Code":"sum_while(nums)","IsDeferred":false},{"Name":"for loop","Code":"sum_for(nums)","IsDeferred":false}]}