{"ScriptPreparationCode":"var class1 = {\r\n GetImportantValue: () =\u003E 1\r\n};\r\nvar class2 = {\r\n GetImportantValue: () =\u003E 2\r\n};\r\nvar class3 = {\r\n GetImportantValue: () =\u003E 3\r\n};\r\nvar class4 = {\r\n GetImportantValue: () =\u003E 4\r\n};\r\nvar class5 = {\r\n GetImportantValue: () =\u003E 5\r\n};\r\n\r\nfunction GetImportantValue1() {\r\n return 1;\r\n}\r\n\r\nfunction GetImportantValue2() {\r\n return 2;\r\n}\r\n\r\nfunction GetImportantValue3() {\r\n return 3;\r\n}\r\n\r\nfunction GetImportantValue4() {\r\n return 4;\r\n}\r\n\r\nfunction GetImportantValue5() {\r\n return 5;\r\n}\r\n\r\ngetImportantValueSwitch = (myClassEnum) =\u003E {\r\n switch (myClassEnum.type) {\r\n case \u0027MyClass1\u0027:\r\n return GetImportantValue1();\r\n case \u0027MyClass2\u0027:\r\n return GetImportantValue2();\r\n case \u0027MyClass3\u0027:\r\n return GetImportantValue3();\r\n case \u0027MyClass4\u0027:\r\n return GetImportantValue4();\r\n case \u0027MyClass5\u0027:\r\n return GetImportantValue5();\r\n }\r\n}\r\n\r\ngetImportantValuePolymorphism = (myClass) =\u003E myClass.GetImportantValue();","TestCases":[{"Name":"Polymorphism","Code":" getImportantValuePolymorphism(class1);\r\n getImportantValuePolymorphism(class2);\r\n getImportantValuePolymorphism(class3);\r\n getImportantValuePolymorphism(class4);\r\n getImportantValuePolymorphism(class5);","IsDeferred":false},{"Name":"Switch","Code":" getImportantValueSwitch({type: \u0027MyClass1\u0027});\r\n getImportantValueSwitch({type: \u0027MyClass2\u0027});\r\n getImportantValueSwitch({type: \u0027MyClass3\u0027});\r\n getImportantValueSwitch({type: \u0027MyClass4\u0027});\r\n getImportantValueSwitch({type: \u0027MyClass5\u0027});","IsDeferred":false}]}