2๐
โ
If you give a working fiddle I can show you what happened.
Basically, because you are modifying the same array object. this.originals
refers to the same array as this.items
Slice returns a shallow copy of the object. You should either take a deep copy or your revert should be the one initializing the object.
this.items.pop();
will remove the items from this.originals
as well.
๐คuser1496463
Source:stackexchange.com