CommentJun 8, 2023
A dumb way to copy an object is using the spread operator. Instead use JSON.parse(JSON.stringify(object)) or JS has a new global function for cloning, checkout structuredClone() https://developer.mozilla.org/en-US/docs/Web/API/structuredClone