1.0.0 • Published 10 years ago
property-names v1.0.0
property-names
Get all property names of an object including those in the prototype chain
installation
// npm
$ npm install property-names
usage
var getAllPropertyNames = require('property-names');
var Thing = function(){};
Thing.prototype.describe = function(){};
var Vehicle = function(){};
Vehicle.prototype = Object.create(Thing.prototype);
Vehicle.prototype.drive = function(){};
Vehicle.prototype.describe = function(){};
var Car = function( brand ){ this.brand = brand; };
Car.prototype = Object.create(Vehicle.prototype);
getAllPropertyNames(new Car()); // [ 'brand', 'drive', 'describe' ]
License
MIT
1.0.0
10 years ago