title: Replace all elements in Knockout.js observableArray
body: <p>I have an <code>observableArray</code> in my view model. After creating the vm I wish to completely replace the data the <code>observableArray</code>. Here's how I'm doing it:</p>
  
  <pre><code>//Initial Setup
  var vm = {};
  vm.roles = ko.observableArray([]);
  ko.applyBindings(vm); 
  
  
  //....replace array later on....
  vm.roles(["1", "2"]);
  </code></pre>
  
  <p>This seems to be working fine, but I was concerned if this was incorrect and might lead to memory leaks. Can anyone conform if this is the preferred way to update an existing <code>observableArray</code> assuming you wish to replace all its data? </p>
  
  <p>I noticed <code>observableArray</code> does have a <code>removeAll()</code> method and wondered if that needed to be called to do this cleanly, or if I'm fine with what I'm doing?</p>