I am working with an array of strings, which was created by splitting a larger string using the `split` operation. Specifically, I am performing some tests on the first two elements of this array:
var tArray = tLongString.split("_")
if (tArray[0] == "local")
{
tArray.shift()
if (tArray[0] == "super") {
...
The issue arises when Typescript complains about the second `if` statement. It claims that I have already checked the value of `tArray[0]`, concluding it to be "local", so it cannot be "super". However, after running the `shift()` command in between, the items are no longer the same.
One workaround is to cast `tArray` to `any`, but I wonder if there is a more Typescript-friendly solution?