{"ScriptPreparationCode":null,"TestCases":[{"Name":"Generator","Code":"function* fibonacci(n) {\r\n const infinite = !n \u0026\u0026 n !== 0\r\n let current = 0\r\n let next = 1\r\n\r\n while (infinite || n--) {\r\n yield current;\r\n [current, next] = [next, current \u002B next]\r\n }\r\n}\r\n\r\nconst [...first100] = fibonacci(100);","IsDeferred":false},{"Name":"Es6 reduce","Code":"const fibonacci = n =\u003E\r\n Array.from({ length: n }).reduce(\r\n (acc, val, i) =\u003E acc.concat(i \u003E 1 ? acc[i - 1] \u002B acc[i - 2] : i),\r\n []\r\n );\r\nconst [...first100] = fibonacci(100);","IsDeferred":false}]}