{"ScriptPreparationCode":"var str = \u0027abc\u0027;\r\nstr = str.charAt(Math.floor(Math.random() * 3));","TestCases":[{"Name":"Switch","Code":"const useSwitch = (str) =\u003E {\r\n switch (str) {\r\n case \u0027a\u0027: return \u0027A\u0027; break\r\n case \u0027b\u0027: return \u0027B\u0027; break\r\n case \u0027c\u0027: return \u0027C\u0027; break\r\n }\r\n}\r\n\r\nconsole.log(useSwitch(str));","IsDeferred":false},{"Name":"Object property","Code":"const useObject = (str) =\u003E {\r\n\r\n let letters = {\r\n a: \u0027A\u0027,\r\n b: \u0027B\u0027,\r\n c: \u0027C\u0027\r\n }\r\n\r\n return letters[str]\r\n}\r\n\r\nconsole.log(useObject(str));","IsDeferred":false},{"Name":"Object with arrow funcion","Code":"var arrow = {\r\n \r\n a: () =\u003E \u0027A\u0027,\r\n b: () =\u003E \u0027B\u0027,\r\n c: () =\u003E \u0027C\u0027\r\n \r\n}\r\n\r\nconsole.log(arrow[str]());","IsDeferred":false},{"Name":"Object with funcion (from the link in description)","Code":"var objLiteral = {\r\n a: function() {\r\n console.log(\u0027A\u0027);\r\n },\r\n b: function() {\r\n console.log(\u0027B\u0027);\r\n },\r\n c: function() {\r\n console.log(\u0027C\u0027);\r\n }\r\n}\r\n\r\nobjLiteral[str]();","IsDeferred":false}]}