{"ScriptPreparationCode":"var str = \u0027abc\u0027;\r\nstr = str.charAt(Math.floor(Math.random() * 3));","TestCases":[{"Name":"Functional Match","Code":"const match = x =\u003E {\r\n const matched = x =\u003E ({\r\n on: () =\u003E matched(x),\r\n otherwise: () =\u003E x,\r\n });\r\n return { \r\n on: (pred, fn) =\u003E (\r\n pred(x)\r\n ? matched(fn(x))\r\n : match(x)\r\n ),\r\n otherwise: fn =\u003E fn(x),\r\n };\r\n}\r\n\r\nmatch(str)\r\n .on(x =\u003E x === \u0027a\u0027, () =\u003E console.log(\u0027A\u0027))\r\n .on(x =\u003E x === \u0027b\u0027, () =\u003E console.log(\u0027B\u0027))\r\n .on(x =\u003E x === \u0027c\u0027, () =\u003E console.log(\u0027C\u0027))\r\n .otherwise(() =\u003E console.log(\u0027default\u0027));\r\n","IsDeferred":false},{"Name":"Switch","Code":"switch (str) {\r\n case \u0027a\u0027: console.log(\u0027A\u0027); break;\r\n case \u0027b\u0027: console.log(\u0027B\u0027); break;\r\n case \u0027c\u0027: console.log(\u0027C\u0027); break;\r\n}","IsDeferred":false}]}