When declaring a type alias, I encountered an issue where I could not initialize it without creating an item:
type ModelState = [string, string[]];
const modelState: ModelState = [null,[]];
modelState["firstName"] = ["First name is required."];
If I try to initialize like this:
const modelState: ModelState = [];
I get an error in TypeScript stating "Type 'undefined[]' is not assignable to type '[string, string[]]'". What would be the correct way to handle this situation?