get-own-property
v1.0.0
Published
Retrieves a property only if hasOwnProperty() is true.
Downloads
6,792
Maintainers
Readme
getOwnProperty
Retrieves a property only if hasOwnProperty()
is true.
Installation
npm install get-own-property --save
Usage
const getOwnProperty = require('get-own-property')
const obj = {hello: 'world'}
getOwnProperty(obj, 'hello') // 'world'
typeof obj.toString // 'function'
getOwnProperty(obj, 'toString') // undefined