grid-packages/ag-grid-docs/documentation/doc-pages/immutable-data/examples/complex-immutable-store/main.js
// makes a copy of the original and merges in the new values
makes a copy of the original and merges in the new values
makes a copy of the original and merges in the new values
function updateImmutableObject(original, newValues) {
    var newObject = {};
    Object.keys(original).forEach( function(key) {
        newObject[key] = original[key];
    });
    Object.keys(newValues).forEach( function(key) {
        newObject[key] = newValues[key];
    });
    return newObject;
}
function updateImmutableObject ( original , newValues ) { var newObject = { } ; Object . keys ( original ) . forEach ( function ( key ) { newObject [ key ] = original [ key ] ; } ) ; Object . keys ( newValues ) . forEach ( function ( key ) { newObject [ key ] = newValues [ key ] ; } ) ; return newObject ; }
makes a copy of the original and merges in the new values
makes a copy of the original and merges in the new values
// start with new object // copy in the old values // now override with the new values