title: How to add code to a function outside of its main body?
body: <p>I want add code to a function, outside of the function and possibly even in an entirely different JS file. Is this possible? How can I do this? Here's a code snippet representing what I've tried so far:</p>
  
  <pre><code>function myViewModel() {
      var self = this;
  
      this.firstName = ko.observable("Mike");
      this.lastName = ko.observable("Rassel");
  
      // this was where I was originally making the call
      //myViewModel.fullName = ko.computed(function() {
      //    return self.firstName() + ' ' + self.lastName();
      })
  }
  
  // this is where the error is happening 
  myViewModel.fullName = ko.computed(function() {
      return self.firstName() + ' ' + self.lastName();
  
  ko.applyBindings(new myViewModel());
  </code></pre>
  
  <p>More code can be viewed at <a href="http://jsfiddle.net/6E7Lq/" rel="nofollow">this JFiddle</a>.</p>