I have a method that does the following:
let object = sportsArray[0]
let newObject = object
newObject.items?.removeAll()
When I do this the 'newObject' 'items' array is now empty which is what I want, but it also is emptying the 'items' array in 'object'..what am I doing wrong here? How do I prevent this from happening. I want to make changes to newObject without those changes affecting the original object. Any help would be greatly appreciated on this. Thanks in advance!