I have an empty string array. I push into it new strings, and I do this one by one. Then, it will happen that the string I'm pushing is already in the array, and I want to find the index of that original string and split the array in the range:
[start, index_of_firstString]
.
So if we have:
myArray: string[] = [];
function(myString: string) {
this.myArray.push(myString);
}
What could be a good solution? I need to check for duplicates every time I push a new string.