Closed redpulp closed 8 hours ago
Related: https://github.com/microsoft/TypeScript/issues/13360#issuecomment-271365952
And in general reverse()
is troublesome for tuples, because it modifies the array in-place.
And in general
reverse()
is troublesome for tuples, because it modifies the array in-place.
Yeah tuples should be immutable by definition, so I get how this would be troublesome here. I only know of dirty tricks to avoid this (like [...array].reverse()
) so I understand the issue, thanks for the comment
⚙ Compilation target
ES2024
⚙ Library
5.6.3
Missing / Incorrect Definition
This loses all information of the order of reversed tuples, I usually have to use the following code to override the behaviour of
Array.prototype.reverse
Sample Code