New type for tuples which have mutable properties but can't be mutated with array methods #48465
Open
5 tasks done
Labels
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
Suggestion
An idea for TypeScript
Suggestion
As the #6325 has been declined to avoid breaking existing codes; I would suggest that we have a "strictTuple" type that denies those array methods on tuples.
π Search Terms
tuple methods
β Viability Checklist
My suggestion meets these guidelines:
β Suggestion
π Motivating Example
π» Use Cases
At the moment, we avoid using array methods like push, pop, shift, unshift when using tuples.
The suggestion above will give developers the option to keep the array methods on tuples or not.
Reference: https://stackoverflow.com/a/64070080/1883323
The text was updated successfully, but these errors were encountered: