var string = "passw)odas4gsdfsdf";
{"ScriptPreparationCode":"var string = \u0022passw)odas4gsdfsdf\u0022;","TestCases":[{"Name":"RegEx","Code":"let isPasswordValid = false;\r\nconst number = new RegExp(\u0027(?=.*[0-9])\u0027);\r\nisPasswordValid = number.test(string);","IsDeferred":false},{"Name":"For Loop","Code":"let isPasswordValid = true;\r\nlet i = 0;\r\nlet len = string.length - 1;\r\nwhile (isPasswordValid) {\r\n \tif (i \u003E= len) break;\r\n\tlet code = string.charCodeAt(i);\r\n \tif (code \u003C= 48 || code \u003E= 57) isPasswordValid = false;\r\n \ti\u002B\u002B;\r\n}","IsDeferred":false}]}