"Empty" the object, optionally keeping structure of subobjects with `{keep: true}` option. Numbers turn to zero, booleans to false, arrays are emptied, etc.
493733
function emptyObject(o, {keep}) {
  keep = keep || {};
  for (let pair of objectPairs(o)) {
    let [k, v] = pair;
    var ctor = v && v.constructor;
    if (keep && ctor === Object) emptyObject(v);
    else o[k] = ctor && ctor();
  }
}
977928
def empty(self, shape, complex=False):
        
        if complex:
            return np.empty(shape, dtype=self.complex, order=self.order)
        return np.empty(shape, dtype=self.float, order=self.order)
626295
function cleanObject(obj) {
  if (obj instanceof Object) {
    Object.keys(obj).forEach((key) => (obj[key] == null) && delete obj[key]);
  }
  return obj;
}
794785
function reduceObject(o, fn, init) {
  for (let pair of objectPairs(o)) {
    let [key, val] = pair;
    init = fn(init, val, key, o);
  }
  return init;
}
159305
function cleanUndefinedProperties(obj) {
  var newObj;
  var isArray = false;
  if (typeof obj === 'object' && obj !== null) {
    if (Array.isArray(obj)) {
      newObj = [];
      isArray = true;
    } else {
      newObj = {};
    }
  } else {
    return obj;
  }
  var keys = Object.keys(obj);
  keys.forEach(function (key, i) {
    if (isArray || typeof obj[key] !== 'undefined') {
      newObj[key] = cleanUndefinedProperties(obj[key]);
    }
  });
  return newObj;
}
79392
function empty() {
  return {
    language: null,
    extendedLanguageSubtags: [],
    script: null,
    region: null,
    variants: [],
    extensions: [],
    privateuse: [],
    irregular: null,
    regular: null
  }
}
891668
function isEmpty (value) {
    if (Array.isArray(value)) {
        return value.length === 0
    } else if (typeof value === 'object') {
        if (value) {
            for (const _ in value) {
                return false
            }
        }
        return true
    } else {
        return !value
    }
}
590427
public function clear(){
        foreach(get_object_vars($this) as $property => $value){
            if(is_array($value)){
                $tempValue = [];
            } else {
                $tempValue = null;
            }

            $this->{$property} = $tempValue;
        }
    }
49879
function isValueEmpty(value) {
  if (_.isUndefined(value)) {
    return true;
  }
  var canUseIsEmpty = _.isString(value) || _.isArray(value) || (_.isObject(value) && !_.isDate(value)) || false;
  if (canUseIsEmpty) {
    return _.isEmpty(value);
  }
  return (_.isNumber(value) || _.isBoolean(value) || _.isDate(value)) ? false : true;
}
1310895
function isEmptyObject(obj) {
    if (obj === null) {
        return true;
    }
    if (!isObject(obj)) {
        return false;
    }

    for (var key in obj) {
        if (obj.hasOwnProperty(key) && obj[key]) {
            return false;
        }
    }

    return true;
}
722224
function remove(obj, keep) {
  if (!obj) return false;
  keep = keep || [];

  for (var prop in obj) {
    if (has.call(obj, prop) && !~keep.indexOf(prop)) {
      delete obj[prop];
    }
  }

  return true;
}
492394
def clear!
      @values.delete_if do |_, value|
        if value.is_a?(::Protobuf::Field::FieldArray) || value.is_a?(::Protobuf::Field::FieldHash)
          value.clear
          false
        else
          true
        end
      end
      self
    end
639637
function empty(a) {
    var hasLength = typeof a === 'string' ||
      Array.isArray(a);
    if (hasLength) {
      return !a.length;
    }
    if (a instanceof Object) {
      return !Object.keys(a).length;
    }
    return false;
  }
533903
function removeAll(object, keys) {
  forValueInArray(keys, unset)

  function unset(key) {
    object[key] = undefined
  }
}
1157333
function (obj) {
			this.writeDebug('hasEmptyObjectVals',arguments);
				var objTest = true;

				for(var key in obj) {
					if (obj.hasOwnProperty(key)) {
						if (obj[key] !== '' && obj[key].length !== 0) {
							objTest = false;
						}
					}
				}

				return objTest;
		}
586791
def isEmpty(self):
        
        if self.obj is None:
            return True
        if self._clean.isString():
            ret = self.obj.strip() is ""
        elif self._clean.isDict():
            ret = len(self.obj.keys()) == 0
        else:
            ret = len(self.obj) == 0
        return self._wrap(ret)
872772
function isEmpty(o) {
  for (var key in o) {
    if (o.hasOwnProperty(key)) {
      return false;
    }
  }
  return Object.getOwnPropertySymbols(o).length === 0;
}