title: knockoutjs deep copy observable array
body: <p>I have an obeservable array in Knockout, say <code>data</code> that contains objects with observable properties. In one part of my application I want to allow users to add to this array and ultimately mess about with it, but if they cancel to revert the array to the original state.</p>
  
  <p>One solution I though of is to create a copy called <code>dataCopy</code> that replaces the original array in the event of cancellation, but this only creates another pointer to the same underlying data, so it will also reflect the changes that were made which is not what I want.
  I've tried converting it to javascript, via <code>ko.toJS(data)</code> and this creates a js array of the data, however all of the objects lose their observable properties and when I re-create the data using <code>ko.observableArray(dataCopy)</code> the app falls over as the properties of the objects are no longer observable.</p>
  
  <p>How can I create a clone of a knockout array rather than another pointer?</p>