{"ScriptPreparationCode":"var item = 33;\r\n\r\nvar data = [\r\n {\r\n range: [10, 11, 12, 13, 14, 15, 16, 17, 18, 19],\r\n value: \u0022less than 20\u0022,\r\n },\r\n {\r\n range: [20, 21, 22, 23, 24, 25, 26, 27, 28, 29],\r\n value: \u0022less than 30\u0022,\r\n },\r\n {\r\n range: [30, 31, 32, 33, 34, 35, 36, 37, 38, 39],\r\n value: \u0022less than 40\u0022,\r\n },\r\n {\r\n range: [40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 25],\r\n value: \u0022less than 50\u0022,\r\n },\r\n ];","TestCases":[{"Name":"if-else","Code":"if (item \u003C 10) {\r\n console.log(\u0022less than 10\u0022);\r\n } else if (item \u003C 20) {\r\n console.log(\u0022less than 20\u0022);\r\n } else if (item \u003C 30) {\r\n console.log(\u0022less than 30\u0022);\r\n } else if (item \u003C 40) {\r\n console.log(\u0022less than 40\u0022);\r\n } else if (item \u003C 50) {\r\n console.log(\u0022less than 50\u0022);\r\n } else {\r\n console.log(\u002250 or more!\u0022);\r\n }","IsDeferred":false},{"Name":"switch","Code":"switch (item) {\r\n case item \u003C 10:\r\n console.log(\u0022less than 10\u0022);\r\n break;\r\n case item \u003C 20:\r\n console.log(\u0022less than 20\u0022);\r\n break;\r\n case item \u003C 30:\r\n console.log(\u0022less than 30\u0022);\r\n break;\r\n case item \u003C 40:\r\n console.log(\u0022less than 40\u0022);\r\n break;\r\n case item \u003C 50:\r\n console.log(\u0022less than 50\u0022);\r\n break;\r\n default:\r\n console.log(\u002250 or more!\u0022);\r\n }","IsDeferred":false},{"Name":"amatch-filter","Code":"const amatch = () =\u003E {\r\n // Exclusions - borders - out-of-bound\r\n if (item \u003C 10) return \u0022less than 10\u0022;\r\n if (item \u003E= 50) return \u002250 or more!\u0022;\r\n // within range\r\n return (data.filter(record =\u003E record.range.includes(item)))[0].value\r\n };\r\n\r\namatch(item);","IsDeferred":false},{"Name":"amatch-find","Code":"const amatch = () =\u003E {\r\n // Exclusions - borders - out-of-bound\r\n if (item \u003C 10) return \u0022less than 10\u0022;\r\n if (item \u003E= 50) return \u002250 or more!\u0022;\r\n // within range\r\n return data.find((record) =\u003E record.range.includes(item)).value;\r\n };\r\n\r\namatch(item);","IsDeferred":false}]}