var string = "asdFORBIDDENasd";
{"ScriptPreparationCode":"var string = \u0022asdFORBIDDENasd\u0022;","TestCases":[{"Name":"RegEx","Code":"let isPasswordValid = false;\r\nlet forbiddenValues = [\u0027test\u0027, \u0027another\u0027, \u0027value\u0027, \u0027other\u0027, \u0027foo\u0027, \u0027bar\u0027, \u0027one\u0027, \u0027two\u0027, \u0027three\u0027, \u0027forbidden\u0027]\r\nlet regexString = forbiddenValues.join(\u0027|\u0027)\r\nlet regex = new RegExp(\u0027.*(\u0027 \u002B regexString \u002B \u0027).*\u0027, \u0027i\u0027);\r\nisPasswordValid = regex.test(string);","IsDeferred":false},{"Name":"For Loop","Code":"let forbiddenValues = [\u0027test\u0027, \u0027another\u0027, \u0027value\u0027, \u0027other\u0027, \u0027foo\u0027, \u0027bar\u0027, \u0027one\u0027, \u0027two\u0027, \u0027three\u0027, \u0027forbidden\u0027]\r\nfor (let val of forbiddenValues) {\r\n if (string.toLowerCase().includes(val)) {\r\n return false;\r\n }\r\n}","IsDeferred":false},{"Name":"RegEx pre-compiled","Code":"let isPasswordValid = false;\r\nconst regex = new RegExp(/.*(test|another|value|other|foo|bar|one|two|three|forbidden).*/i);\r\nisPasswordValid = regex.test(string);","IsDeferred":false}]}