title: Strange behavior of computed property in objects in observableArray in Knockout.js
body: <p>I have a strange problem, where I have an object - lets call it Person - which has the observable properties FirstName and Lastname, and a third computed property called FullName. In my ViewModel I have an observable array of these Person objects. I also have a function to push an empty Person to the array.</p>
  
  <p><strong>Here comes the strange part.</strong> </p>
  
  <p>When I add one person, change the FirstName and LastName, the computed FullName becomes the concatenation of the first and last name - this is the expected behaviour. If I then add another person object, change that objects FirstName or LastName property and then return to change the first person FirstName, the computed FullName of both Person objects is now the concatenation of the first and lastname properties of only the last Person. </p>
  
  <p><strong>Here is the code:</strong></p>
  
  <pre><code>function Person(data)
  {
      self = this;
      self.FirstName = ko.observable(data !== undefined ? data.FirstName : "");
      self.LastName = ko.observable(data !== undefined ? data.LastName : "");
      self.FullName = ko.computed(function ()
      {
          return self.FirstName() + " " + self.LastName();
      });
  };
  function ViewModel() {
      var self = this;
      self.People = ko.observableArray([]);
  
      self.AddPerson = function()
      {
          self.People.push(new Person());        
      }
  }
  
  ko.applyBindings(new ViewModel());
  </code></pre>
  
  <p><strong>...and the problem can be recreated in <a href="http://jsfiddle.net/AkHhJ/1/" rel="nofollow">this Fiddle</a> using following steps:</strong></p>
  
  <ol>
  <li>Press Add</li>
  <li>Fill random text in both of the inputs</li>
  <li>Observe the concatenated inputs below the button</li>
  <li>Press Add again</li>
  <li>Fill random text in either of the two new inputs</li>
  <li>Change the value of one of the first inputs</li>
  <li>Observe that the concatenated inputs are now exactly the same.</li>
  </ol>
  
  <p>How can I get this seemingly simple scenario to work properly?</p>
  
  <p>Any help is appreciated. Thank you in advance. </p>