has-own-property

v1.0.0arrow_drop_down
v1.0.0
v0.0.1
STATUS
Passing
DOWNLOADS
86
VISIBILITY
Public
PUBLISHED
7 years ago
SIZE
478 B
Determines whether the object has the specified property.
1 contributor
Install has-own-property as a package?
Copied
npm i @bit/ach5910.mefrontend.object.has-own-property
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
chevron_left
chevron_right
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 null

Pass
Help and resources