Share your code. Components are building blocks, you are the architect.

object/has-own-property
v1.0.0
1.0.0
0.0.1
MIT
PUBLIC
197
0     DEPENDENCIES
Build: pass
BuildPass
Build Status: pass
Determines whether the object has the specified property.
bit
Contributors
Gravatar for undefinedGravatar for undefined
1

Please configure Bit as a scoped registry to install components with NPM.Learn more

npm config set '@bit:registry' https://node.bitsrc.io
Use object/has-own-property in your project
npm i @bit/bit.utils.object.has-own-property
Copied

hasOwnProperty (obj:object, prop:(string | number)) : boolean

Determines whether the object has the specified property.

Example

hasOwnProperty({foo: 'bar'}, 'foo') // => true
 hasOwnProperty({foo: 'bar'}, 'bar') // => false

Arguments

obj: object

prop: (string | number)

property to test

Returns

boolean

Test Summary


#hasOwnProperty() should return false as given object do not contain key `bar`Pass
#hasOwnProperty() should return true as given object contains key `foo`Pass
#hasOwnProperty() should return false if key is nullPass