Function setNonEnumerable

  • Sets the specified properties of an object as non-enumerable.

    Parameters

    • object: Record<ObjectKey, any>

      The object whose properties are to be set as non-enumerable.

    • Rest ...properties: string[]

      The names of the properties to be set as non-enumerable.

    Returns void

    Remarks

    This function modifies the original object by setting the specified properties as non-enumerable. If the object or any of the property names are not valid, it throws an error.

    Throws

    Will throw an error if any of the specified properties do not exist on the object.

    Example

    setNonEnumerable({ a: 1, b: 2, c: 3 }, 'a', 'b');
    Object.keys({ a: 1, b: 2, c: 3 });;
    //=> ['c']

Generated using TypeDoc