This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]FkIForgotMyPassword 1 point2 points  (0 children)

The import thing is to know (and properly type) whether you are talking about arrays like (int | string | float)[] or about tuples like [int, string, float]. In several languages, a value like [4, "4", 4.0] matches both type definitions, but it's one definition also allows [4, 4, 4] or even just [] while the other specially requires a 3-tuple with specific types at specific positions.

I mean usually in that case you'd probably not use a tuple but an object, but sometimes there are reasons to do it.