I have variable with a type as
let campaigns : {
[key: string] : string[]
} | string[] = []
As we can see in a logic variable is either one or another type. When I know for sure in my logic that is an array I will try to use as campaigns.push("string"). But I will get Typescript error as saying that you can't use push on object, cause typescript doesn't know that in my logic I illuminated a chance on been an object. How let Typescript know that campaign.push() is a legal operation ?