title: Computed that returns a sorted observableArray
body: <p>I have a computed observable that returns a filtered, sorted version of my <code>observableArray</code> but the sort is not working at all.</p>
  
  <p>Here is <a href="http://jsfiddle.net/bflemi3/BPBa7/2/" rel="nofollow">My fiddle</a></p>
  
  <pre><code>String.prototype.contains = function (value) {
      return this.indexOf(value) != -1;
  };
  
  function Item(data) {
      this.name = ko.observable(data);
  }
  
  function ViewModel() {
      var self = this;
      this.items = ko.observableArray([new Item('John'), new Item('Pat')]);
      this.filterValue = ko.observable();
  
      this.filteredItems = ko.computed(function() {
          var filterValue = self.filterValue();
  
          if(!filterValue)
              return self.items();
  
          return ko.utils.arrayFilter(self.items(), function(){
              return item.name().toLowerCase().contains(filterValue.toLowerCase());
          }).sort(function(a,b){
              return a.name == b.name ? 0 : (a.name &lt; b.name ? -1 : 1);
          });
      });
  }
  </code></pre>
  
  <p><strong>THE ANSWER</strong>
  Here's the update <a href="http://jsfiddle.net/bflemi3/BPBa7/10/" rel="nofollow">fiddle</a></p>