get-own-property

Retrieves a property only if hasOwnProperty() is true.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
get-own-property
1.0.05 years ago5 years agoMinified + gzip package size for get-own-property in KB

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