1.0.0 • Published 6 years ago

@kingjs/descriptor.object.remove v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

@kingjs/descriptor.object.remove

Returns a descriptor with a property removed.

Usage

Remove the property 'x' like this:

var remove = require('@kingjs/descriptor.object.remove');

var descriptor = { x:0 };
remove.call(descriptor, 'x');

result:

{ }

API

declare function remove(
  this: Descriptor,
  key: string
): Descriptor

Interfaces

Parameters

  • this: The descriptor from which property key 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.object.remove

License

MIT

Analytics