{"ScriptPreparationCode":"const heights = [\u00606\u0027\u0060, \u00605\u00273\u0022\u0060, \u006011\u0022\u0060, \u00600\u00278\u0022\u0060, \u00604\u00270\u0022\u0060]","TestCases":[{"Name":"RegEx","Code":"const heightRegex = /(?:^|(\\d\u002B)[\u0027])(?:$|(\\d\u002B)[\u0022])/\r\nfor (const height of heights) {\r\n const result = height.match(heightRegex);\r\n console.log(\u0022Height in inches: \u0022, ((result[1] ?? 0) * 12) \u002B (result[2] ?? 0));\r\n}","IsDeferred":false},{"Name":"split()","Code":"for (const height of heights) {\r\n const hasFeet = height.includes(\u0060\u0027\u0060);\r\n const hasInches = height.includes(\u0060\u0022\u0060);\r\n let value = 0\r\n if (hasFeet \u0026\u0026 hasInches) {\r\n const heightArray = height.split(\u0060\u0027\u0060)\r\n const feet = Number(heightArray[0])\r\n const inches = Number(heightArray[1]?.split(\u0060\u0022\u0060)[0])\r\n value = feet * 12 \u002B inches;\r\n }\r\n else if (hasFeet) {\r\n value = Number(height.split(\u0060\u0027\u0060)[0]) * 12\r\n }\r\n else if (hasInches) {\r\n value = Number(height.split(\u0060\u0022\u0060)[0]);\r\n }\r\n console.log(\u0022Height in inches: \u0022, value)\r\n}","IsDeferred":false}]}