Skip to main content

removeItems

Stentor API Reference


Stentor API Reference / stentor-utils/src / removeItems

Function: removeItems()

removeItems(obj, attrs): any

Defined in: packages/stentor-utils/src/object/index.ts:18

A function that's the opposite of "subset" in which it will remove the attributes that are given in the function.

The original object is not affected.

Parameters​

obj​

any

Object to remove the items from.

attrs​

The attribute keys to remove from the object. It can be strings for generic javascript objects or numbers for arrays. It can also be a function that returns a boolean where "true" means to keep and "false" means to remove. In the case for functions, the first parameters will be the "key" of the object (string for objects and numbers for arrays.).

(string | number)[] | ValidateKeyCallback

Returns​

any