Skip to content
Forcefully delete a property from an object
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
.istanbul.yml
.jshintrc
.npmignore
.travis.yml
LICENSE
README.md
binding.gyp
index.js
package.json
test.js

README.md

node-force-delete Travis-CI.org Build Status Coveralls.io Coverage Rating

Forcfully delete a property from an object. Works even with un-configurable property descriptors.

var forceDelete = require('force-delete');

var obj = { foo = 'bar' };
forceDelete(obj, 'foo');
console.log(obj);                             //-> {}

var fn = function(a, b, c) { /* ... */ };
forceDelete(fn, 'length');
console.log(fn.length);                       //-> 0
Object.defineProperty(fn, 'length', {
  value: 10
});
console.log(fn.length);                       //-> 10

License

Licensed under the MIT license

You can’t perform that action at this time.