JavaScript克隆一个“类”实例
这个问题在这里已经有了答案:
  $.extend仅克隆普通对象。  如果该对象有一个构造函数,那么它不会被克隆,而只是被复制。 
  来自$.extend源代码: 
if ( jQuery.isPlainObject(copy) /* ... */) {
  // do the recursive $.extend call and clone the object                
} else if ( copy !== undefined ) {
  target[ name ] = copy;
  // ^^^^^ just copy
}
  所以$.extend()会调用isPlainObject(el) ,它将返回false,因为el有一个构造函数,而不是克隆el 。  因此, states[1].elements[0]与states[0].elements[0] states[1].elements[0]是同一个对象,因为它没有被克隆。 
如果我们修改您的示例:
function Element(){
  this.changes = {};
}
var el = new Element();    // $.isPlainObject(el); <- false
// ...
成:
var el = { changes: {} };  // $.isPlainObject(el); <- true
// ...
  它会正确地克隆el 。  在这里看到它。 
您可以使用http://documentcloud.github.com/underscore/#clone克隆对象,如:
var cloned = _.clone(states[0]);
