I have an array with objects having observable and non-observable properties in my knockout JS project which I want to copy so I can have a temporary array that can replace the original one after confirmation. Before the comfirmation, I recalculate one of the observable values of the objects in the array, but without confirmation, I don't want to edit the original array, which sadly happens. I tried several methods to deep copy the array (.slice(0), simply tempArray(array), tempArray(ko.observable(array()), even with jQuery $.extend() and ko.mapping.fromJS etc.), but none of them works for me. The ko.mapping.fromJS changed all of my non-observable properties to observables, in all the other cases, i could not get rid of the binding and the original array was changed as well.
So, what is the best way to deep copy a knockoutJS array without changing the contained objects' properties from observable to non-observable or vice versa (and of course without editing the original array)?