I'm matching an array of strings against a regex:
for (let subject_index in subjects) {
if (subjects[subject_index].match(/.*Overview of Investor.*/i)) {
subjects.splice(subject_index, 1)
}
}
The array subjects contains nine identical strings, all of them Overview of Investor. When I run this loop, it correctly matches five of the strings and does not match on the other four, even though all the strings are identical. Am I missing something?