Reputation: 15336
Is there a way to define variable-length Array tuple?
["string", 1, 1, 1, 1, 1]
["string", 1]
Something like
type StringNumbers = [string, ...number]
Upvotes: 5
Views: 1188
Reputation: 249576
You can use rest in tuples:
type StringNumbers = [string, ...number[]]
Upvotes: 7