I have a single dimensional array with the below format,
let e = ["CGST:20", "SGST:20", "IGST:20", "CESS:20", "GSTIncentive:20", "GSTPCT:20"].map(i=>i.trim());
And want to match the specific string in the array, say for example, match the part of the string "IGST" in the "IGST:20".
I have tried in the below way, but it always matching the first key in the array,
if(/^IGST:/.test(e)){
console.log("matched")
} else {
console.log("Not matched")
}