• 0 Posts
  • 11 Comments
Joined 1 year ago
cake
Cake day: April 10th, 2024

help-circle

  • Could be that I misread but I think you’re misunderstanding types in Typescript.

    You have an array of 1 or 2 values of unbounded size. You put two values in but could have put 1000 in, your type doesn’t say anything about that. You can only put ones or twos in there though.

    I think your first line is equivalent to saying:

    type MyStringType = string[];
    

    I haven’t checked though so I might be wrong…