public/js-roguelike-skeleton/src/util.js
function(destination){
            var sources = Array.prototype.slice.call(arguments, 1);
            for (var i = 0; i < sources.length; i++) {
                var source = sources[i];
                for(var key in source){
                    destination[key] = source[key];
                }
            }
            return destination;
        }
function(destination){
            var sources = Array.prototype.slice.call(arguments, 1);
            for (var i = 0; i < sources.length; i++) {
                var source = sources[i];
                for(var key in source){
                    destination[key] = source[key];
                }
            }
            return destination;
        }
function ( destination ) { var sources = Array . prototype . slice . call ( arguments , 1 ) ; for ( var i = 0 ; i < sources . length ; i ++ ) { var source = sources [ i ] ; for ( var key in source ) { destination [ key ] = source [ key ] ; } } return destination ; }
Copy all of the properties in the source objects over to the destination object, and return the destination object.
It's in-order, so the last source will override properties of the same name in previous arguments.
@method merge
@static
@param {Object} destination - The object to copy properties to.
@param {Object} source* - The object to copy properties from.
@return {Object} The `destination` object.
Copy all of the properties in the source objects over to the destination object and return the destination object . It s in - order so the last source will override properties of the same name in previous arguments .