title: Sort KnockoutJS observable array element dynamically
body: <p>Suppose my observable array contains a list of tags with property selected:</p>
  
  <pre><code>myModel = {
   tags: ko.observableArray([
     {name: "tag1", selected: ko.observable()},
     {name: "tag2", selected: ko.observable(true)},
     ...
   ])
  } 
  </code></pre>
  
  <p>Now I want the tags array sort dynamically based on the <code>selected()</code> attribute, say if a tag is selected, then it should be move to the top of the list.</p>
  
  <p>Any idea how to get this done?</p>