{"ScriptPreparationCode":"// Switch\r\nfunction thing(j)\r\n{\r\n switch(j)\r\n {\r\n case 0:\r\n return \u0022rah\u0022;\r\n case 1:\r\n return \u0022lah\u0022;\r\n case 2:\r\n return \u0022sah\u0022;\r\n case 3:\r\n return \u0022blah\u0022;\r\n }\r\n}\r\n\r\n// Jumptable\r\nfunction rah()\r\n{\r\n return \u0022rah\u0022;\r\n}\r\n\r\nfunction lah()\r\n{\r\n return \u0022lah\u0022;\r\n}\r\n\r\nfunction sah()\r\n{\r\n return \u0022sah\u0022;\r\n}\r\n\r\nfunction blah()\r\n{\r\n return \u0022blah\u0022;\r\n}\r\n\r\nvar jumpTable = [rah, lah, sah, blah];\r\n\r\n// Arrow functions\r\nvar jumpTableArrow = [() =\u003E \u0022rah\u0022, () =\u003E \u0022lah\u0022, () =\u003E \u0022sah\u0022, () =\u003E \u0022blah\u0022]\r\n\r\n// Map\r\nvar jumpTableMap = new Map(jumpTableArrow.map((fun, i) =\u003E [i, fun]))","TestCases":[{"Name":"switch case","Code":"\r\n\r\nfor(let i = 0; i \u003C 100000; i\u002B\u002B)\r\n{\r\nfor(let j = 0; thing(j) != \u0022blah\u0022; j\u002B\u002B)\r\n{\r\n \r\n}\r\n}\r\n\r\n\r\n","IsDeferred":false},{"Name":"jump table","Code":"for(let i = 0; i \u003C 100000; i\u002B\u002B)\r\n{\r\nfor(let j = 0; jumpTable[j]() != \u0022blah\u0022; j\u002B\u002B)\r\n{\r\n \r\n}\r\n}\r\n\r\n\r\n","IsDeferred":false},{"Name":"jump table (arrow functions)","Code":"for(let i = 0; i \u003C 100000; i\u002B\u002B)\r\n{\r\nfor(let j = 0; jumpTableArrow[j]() != \u0022blah\u0022; j\u002B\u002B)\r\n{\r\n \r\n}\r\n}","IsDeferred":false},{"Name":"jump table (Map)","Code":"for(let i = 0; i \u003C 100000; i\u002B\u002B)\r\n{\r\nfor(let j = 0; jumpTableMap.get(j)() != \u0022blah\u0022; j\u002B\u002B)\r\n{\r\n \r\n}\r\n}","IsDeferred":false}]}