code: function merge(object1, object2) {
    if (!object1 || Object.keys(object1).length === 0) {
      return object2;
    }
    if (!object2 || Object.keys(object2).length === 0) {
      return object1;
    }
    return {
      ...object1,
      ...object2
    };
  }
docs: Merge two objects.
  The order is important here: o1.merge(o2) means that the keys values of o2
  will replace those identical to o1.
  The keys that don't belong to the other object will be added.
  @param object1 the object whose properties might be overridden by object2.
  @param object2 the object to be merged with.
  @returns {Object} the object result of the merge