When newScore is updated, I want to make sure that oldScore remains unaffected. Can someone help with this?
newScore and oldScore are separate objects, so any changes made to one should not be reflected in the other.
To prevent updates from affecting both objects, I have used Object.assign({}, words.oldScore) to assign oldScore to newScore.
Thank you