How can I determine the types of values in a string[] | object[]
array to perform different operations based on the value type?
I attempted to check the type of the first item in the array, but TypeScript does not recognize it and still considers it as string[] | object[]
.
I also tried using every method to verify each value type, however TypeScript does not permit the use of every or filter functions with string[] | object[]
arrays.