If you need to create your extend function
Object.prototype.extend = function(x) {
for(i in x)
this[i] = x[i];
};
$scope.book1.extend($scope.book2);
If you are using angularjs you can have a look at http://docs.angularjs.org/api/angular.extend