Sham for ES6 Object.getOwnPropertyDescriptor
npm install object-get-own-property-descriptor-x href="https://travis-ci.org/Xotic750/object-get-own-property-descriptor-x"
title="Travis status"> src="https://travis-ci.org/Xotic750/object-get-own-property-descriptor-x.svg?branch=master"
alt="Travis status" height="18">
href="https://david-dm.org/Xotic750/object-get-own-property-descriptor-x"
title="Dependency status"> alt="Dependency status" height="18"/>
href="https://david-dm.org/Xotic750/object-get-own-property-descriptor-x?type=dev"
title="devDependency status"> alt="devDependency status" height="18"/>
href="https://badge.fury.io/js/object-get-own-property-descriptor-x"
title="npm version"> alt="npm version" height="18">
href="https://www.jsdelivr.com/package/npm/object-get-own-property-descriptor-x"
title="jsDelivr hits"> alt="jsDelivr hits" height="18">
href="https://bettercodehub.com/results/Xotic750/object-get-own-property-descriptor-x"
title="bettercodehub score"> alt="bettercodehub score" height="18">
href="https://coveralls.io/github/Xotic750/object-get-own-property-descriptor-x?branch=master"
title="Coverage Status"> alt="Coverage Status" height="18">
Sham for ES6 Object.getOwnPropertyDescriptor
This method returns a property descriptor for an own property (that is,
one directly present on an object and not in the object's prototype chain)
of a given object.
Kind: Exported member
Returns: Object - A property descriptor of the given property if it exists on the object, undefined otherwise.
| Param | Type | Description |
| -------- | --------------- | -------------------------------------------------------------- |
| object | \* | The object in which to look for the property. |
| property | \* | The name of the property whose description is to be retrieved. |
Example
``js``
import getOwnPropertyDescriptor from 'object-get-own-property-descriptor-x';
const obj = {bar: 42};
console.log(getOwnPropertyDescriptor(o, 'bar'));
// {
// configurable: true,
// enumerable: true,
// value: 42,
// writable: true
// }