{"ScriptPreparationCode":"var IDLE = 0;\r\nvar CONSOLE_LOG = 1;\r\nvar CONSOLE_WARN = 2;\r\nvar CONSOLE_ERROR = 3;\r\nvar CONSOLE_INFO = 4;\r\nvar COMPLETE = 5;\r\nvar currentState = IDLE;\r\nvar string = \u0027Hello World!\u0027;\r\n\r\nfunction functionSwitchLoop() {\r\n switch(currentState) {\r\n case IDLE:\r\n currentState = CONSOLE_LOG;\r\n return functionSwitchLoop();\r\n case CONSOLE_LOG:\r\n console.log(string);\r\n currentState = CONSOLE_WARN;\r\n return functionSwitchLoop();\r\n case CONSOLE_WARN:\r\n console.warn(string);\r\n currentState = CONSOLE_ERROR;\r\n return functionSwitchLoop();\r\n case CONSOLE_ERROR:\r\n console.error(string);\r\n currentState = CONSOLE_INFO;\r\n return functionSwitchLoop();\r\n case CONSOLE_INFO:\r\n console.info(string);\r\n return currentState = COMPLETE;\r\n };\r\n};","TestCases":[{"Name":"if loop","Code":"if(currentState === IDLE) {\r\n \tcurrentState = CONSOLE_LOG;\r\n};\r\nif(currentState === CONSOLE_LOG) {\r\n \tconsole.log(string);\r\n \tcurrentState = CONSOLE_WARN;\r\n};\r\nif(currentState === CONSOLE_WARN) {\r\n \tconsole.warn(string);\r\n \tcurrentState = CONSOLE_ERROR;\r\n};\r\nif(currentState === CONSOLE_ERROR) {\r\n \tconsole.error(string);\r\n \tcurrentState = CONSOLE_INFO;\r\n};\r\nif(currentState === CONSOLE_INFO) {\r\n \tconsole.info(string);\r\n \tcurrentState = COMPLETE;\r\n};\r\nif(currentState === COMPLETE) currentState = IDLE;","IsDeferred":false},{"Name":"while \u002B switch/case loop","Code":"while(currentState != COMPLETE) {\r\n \tswitch(currentState) {\r\n \tcase IDLE:\r\n \t\t\tcurrentState = CONSOLE_LOG;\r\n \tbreak;\r\n \tcase CONSOLE_LOG:\r\n \t\t\tconsole.log(string);\r\n \t\t\tcurrentState = CONSOLE_WARN;\r\n \tbreak;\r\n \tcase CONSOLE_WARN:\r\n \t\t\tconsole.warn(string);\r\n \t\t\tcurrentState = CONSOLE_ERROR;\r\n \tbreak;\r\n \tcase CONSOLE_ERROR:\r\n \t\t\tconsole.error(string);\r\n \t\t\tcurrentState = CONSOLE_INFO;\r\n \tbreak;\r\n \tdefault:\r\n \t\t\tconsole.info(string);\r\n \tcurrentState = COMPLETE;\r\n\t};\r\n};\r\ncurrentState = IDLE;","IsDeferred":false},{"Name":" function \u002B switch/case loop","Code":"functionSwitchLoop();\r\ncurrentState = IDLE;","IsDeferred":false}]}