Order.prototype.selectItem = function(newItem) { ...
newItem
is the object I want to copy and then modify the copy without modifying the original newItem.
var newSelectedItem = newItem;
newSelectedItem.orderIndex = this.selectedItems.length + 1;
Changing the orderIndex of the copy will also change the original newItem.
Question: How do I copy and then modify the copy without modifying the original newItem.
Thanks!