function remove(obj, key) {
  let rv;
  if (rv = key in /** @type {!Object} */ (obj)) {
    delete obj[key];
  }
  return rv;
}
Removes a key-value pair based on the key.
@param {?Object} obj The object from which to remove the key.
@param {?} key The key to remove.
@return {boolean} Whether an element was removed.