{"ScriptPreparationCode":null,"TestCases":[{"Name":"for loop","Code":"const format = \u0027MM/DD/YYYY\u0027;\r\nconst inputs = [\u00270\u0027, \u00271\u0027, \u00270\u0027, \u00273\u0027, \u00272\u0027,\u00270\u0027,\u00270\u0027 ]\r\nconst dateTxtArray = [];\r\n\r\nconst formatArray = Array.from(format);\r\nfor (let i = 0; i \u003C formatArray.length; i\u002B\u002B) {\r\n\t\t\t\tif (formatArray[i] === \u0027/\u0027) {\r\n\t\t\t\t\tdateTxtArray.push(formatArray.splice(i, 1)[0] ?? \u0027\u0027);\r\n\t\t\t\t}\r\n\t\t\t\tdateTxtArray.push(inputs[i] ?? formatArray[i] ?? \u0027\u0027);\r\n\t\t\t}\r\nconst dateTxt = dateTxtArray.join(\u0027\u0027);\r\nreturn dateTxt;\r\n","IsDeferred":false},{"Name":"regex","Code":"const format = \u0027MM/DD/YYYY\u0027;\r\nconst inputs = [\u00270\u0027, \u00271\u0027, \u00270\u0027, \u00273\u0027, \u00272\u0027,\u00270\u0027,\u00270\u0027 ]\r\n\r\nmyInputs = inputs.join(\u0022\u0022).replace(/^(\\d{2})/g, \u0027$1/\u0027).replace(/^(\\d{2}\\/\\d{2})/g, \u0027$1/\u0027);\r\nreturn myInputs \u002B format.substr(myInputs.length);","IsDeferred":false}]}