var componentName = "dc_monitor";
{"ScriptPreparationCode":"var componentName = \u0022dc_monitor\u0022;","TestCases":[{"Name":"For loop","Code":"function isValidComponent(component) {\r\n\tif (typeof component === \u0022string\u0022\r\n\t\t\u0026\u0026 component.length \u003E 2\r\n\t\t\u0026\u0026 component.length \u003C 10) {\r\n\t\t// component should contain only letters\r\n\t\tfor (const char of component) {\r\n\t\t\tif (char \u003C \u0022a\u0022 || char \u003E \u0022z\u0022) {\r\n\t\t\t\treturn false\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nlet isValid = isValidComponent(componentName);","IsDeferred":false},{"Name":"Regex","Code":"function isValidComponent(component) {\r\n\t\treturn component.length \u003E 2 \u0026\u0026 component.length \u003C 10 \u0026\u0026 /^[a-z]\u002B$/.test(component);\r\n}\r\n\r\nlet isValid = isValidComponent(componentName);","IsDeferred":false}]}