kingjs/descriptor.remove
@Returns a descriptor with a property removed.
Usage
Remove the property 'x' like this:
var remove = require('@kingjs/descriptor.remove');
var descriptor = { x:0 };
remove.call(descriptor, 'x');
result:
{ }
API
declare function remove(
this: Descriptor,
key: string
): Descriptor
Interfaces
-
Descriptor
: see @kingjs/descriptor
Parameters
-
this
: The descriptor from which propertykey
will be removed. -
key
: The property to be removed.
Returns
Returns a descriptor with property key
removed. A copy is returned if the descriptor has an inherited property key
or the descriptor is frozen. If this
is an array then subsequent values are shifted left over the removed index.
Install
With npm installed, run
$ npm install @kingjs/descriptor.remove
License
MIT