title: KnockoutJS - Assign Observable value to JavaScript variable
body: <p>I am trying to see if I can assign a JavaScript variable to the value of a value of a KO Observable.  </p>
  
  <p>The reason for this is I want to assign it to a jquery module, as a property.  </p>
  
  <p>I know I can do:</p>
  
  <pre><code>    var viewModel = {
      firstName : ko.observable("Bert"),
      lastName : ko.observable("Smith"),
      pets : ko.observableArray(["Cat", "Dog", "Fish"]),
      type : "Customer"
  };
  viewModel.hasALotOfPets = ko.computed(function() {
      return this.pets().length &gt; 2
  }, viewModel)
  
  
  var jsonData = ko.toJSON(viewModel);
  </code></pre>
  
  <p>But, what if I don't want everything that is in the view model?  Can i just only select n number of items?</p>