title: Sort list with items, order alphabetically
body: <p>I want to sort two lists with items and order them alphabetically by firstletter in the name. </p>
  
  <p>I've tried this, without any success:</p>
  
  <pre><code>var ViewModel = function() {
      var self = this;
  
      self.storedProceduresInDB1 = ko.observableArray([{
         Name: "A",
         Id: 1
      }, {
         Name: "C",
         Id: 3
      }, {
         Name: "B",
         Id: 4
      }, {
         Name: "D",
         Id: 2
      }]);
  
      self.storedProceduresInDB2 = ko.observableArray([{
         Name: "C",
         Id: 3
      }, {
         Name: "E",
         Id: 8
      }, {
         Name: "F",
         Id: 7
      }, {
         Name: "B",
         Id: 4
      }]);
  
      self.sortLists = function () {
         self.storedProceduresInDB1.sort(function (left, right) {
              return left.name == right.name ? 0 : (left.name &lt; right.name ? -1 : 1);
         });
  
         self.storedProceduresInDB2.sort(function (left, right) {
              return left.name == right.name ? 0 : (left.name &lt; right.name ? -1 : 1);
         });
      };
  }
  </code></pre>
  
  <p><a href="http://jsfiddle.net/7zp5K/38/" rel="nofollow">JSFiddle</a></p>