function omit(key) {
  return object => {
    const { [key]: toRemove, ...rest } = object;
    return rest;
  };
}
Returns a function that can be called with an object. The return value of the
new function is a copy of the object excluding the key passed initially.