Warlockk
Is this correct for Javascript?
Thanks for the reply, i actually i'm not sure if i'm wrong
I think that do use of
.clone()
to create a new mutable instance is the correct way to handle mutations with Tuples
If not, a better way could be create a new mutable common Array instance of the tuple, using Array.from
If we're talking about performance issues, to avoid the 2 steps (creation/modification) the .clone()
method could receive a "mutator". .clone(Array.prototype.reverse)
or a enum value .clone(MutationType.Reversed)
11 replies