3.7.134 • Published 11 months ago

@patrtorg/reiciendis-doloribus-officia v3.7.134

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

hasOwnProperty

NPM version Build Status Coverage Status

Test if an object has a specified property.

Installation

npm install @patrtorg/reiciendis-doloribus-officia

Alternatively,

  • To load the package in a website via a script tag without installation and bundlers, use the ES Module available on the esm branch (see README).
  • If you are using Deno, visit the deno branch (see README for usage intructions).
  • For use in Observable, or in browser/node environments, use the Universal Module Definition (UMD) build available on the umd branch (see README).

The branches.md file summarizes the available branches and displays a diagram illustrating their relationships.

To view installation and usage instructions specific to each branch build, be sure to explicitly navigate to the respective README files on each branch, as linked to above.

Usage

var hasOwnProp = require( '@patrtorg/reiciendis-doloribus-officia' );

hasOwnProp( value, property )

Returns a boolean indicating if a value has a specified property.

var value = {
    'beep': 'boop'
};

var bool = hasOwnProp( value, 'beep' );
// returns true

bool = hasOwnProp( value, 'bap' );
// returns false

Notes

  • In contrast to the native Object.prototype.hasOwnProperty, this function does not throw when provided null or undefined. Instead, the function returns false.

    var bool = hasOwnProp( null, 'a' );
    // returns false
    
    bool = hasOwnProp( void 0, 'a' );
    // returns false
  • Value arguments other than null or undefined are coerced to objects.

    var bool = hasOwnProp( 'beep', 'length' );
    // returns true
  • Property arguments are coerced to strings.

    var value = {
        'null': false
    };
    var bool = hasOwnProp( value, null );
    // returns true
    
    value = {
        '[object Object]': false
    };
    bool = hasOwnProp( value, {} );
    // returns true

Examples

var hasOwnProp = require( '@patrtorg/reiciendis-doloribus-officia' );

var bool = hasOwnProp( { 'a': 'b' }, 'a' );
// returns true

bool = hasOwnProp( { 'a': 'b' }, 'c' );
// returns false

bool = hasOwnProp( { 'a': 'b' }, null );
// returns false

bool = hasOwnProp( {}, 'hasOwnProperty' );
// returns false

bool = hasOwnProp( null, 'a' );
// returns false

bool = hasOwnProp( void 0, 'a' );
// returns false

bool = hasOwnProp( { 'null': false }, null );
// returns true

bool = hasOwnProp( { '[object Object]': false }, {} );
// returns true

See Also


Notice

This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

Community

Chat


License

See LICENSE.

Copyright

Copyright © 2016-2024. The Stdlib Authors.

reduxsidetermECMAScript 2019iteratorsymlinkECMAScript 2018ECMAScript 2016codesnpmprettyeslint-pluginloadbalancingstringifierargvBigInt64Arraynegative zerocommandfast-deep-cloneemrargumentconsoleoptimiststoragegatewayairbnbjasmineESnextshrinkwrapmime-dbECMAScript 7variableses7viewdataviewtypeerrorsliceserializationES2018has-owncommand-lineproxylastUint32Arraysuperstructcensor0globeventDispatcherRxJSlooktrimEndconsumelinkfast-clonechildmomentpositivelruArray.prototype.flattenfast-deep-copyString.prototype.matchAllawsInt16Arraycall-boundbundlingterminalrequestbytefixed-widthdeep-cloneArray.prototype.includesshimtrimLeftstyled-componentsconfigurableunicodepackage managertostringtagcallbackregexguidmaptc39[[Prototype]]findupextensiones2015flatschemaRegExp.prototype.flags-0coercibleObject.getPrototypeOfcssruntimeES2016mobileObject.valuesaccessibilitynopefastcopyWeakSetlockfilexdg-openspawnstructuredClonetapqssameValueZeroes2017routingkoreandotenvtrimframeworkasciideepcloneES2022rgbwgetArray.prototype.flatmakeinternalconcatMapECMAScript 2021internal slot@@toStringTagprivate dataestoolkitdependenciesfind-upReflect.getPrototypeOfcolumnreadzodnameArray.prototype.findLastIndexamazonfigletsomecloudtrailchromerandomparsersyntaxerrorbindtypescriptthrottlefilecoreeslintconfigenvironmentsqueryYAMLxhrcolourcommandersearchES2023hasOwnPropertybuffersparentsdateECMAScript 5typesafewidthframerbyteLengthescapedescriptiondom-testing-libraryStyleSheetinstalloncerm -rfprototypemochamapreduceincludeszeroWeakMapcompilertoStringTagsqsTypedArrayparentUint16ArrayweakmapUint8ClampedArrayIteratortoSortedclass-validatorurlslistenersvestespreeregular expressionconvertcheckprivatehashredactwarningvarsES3l10nInt32ArraysequencesortednativenegativeexecReactiveExtensionsArrayBuffer#slicetoolsArraycomputed-typesclonedomenvironmentdefaultasynctypedstylesURLpropertykeysendergenericsAsyncIteratorhasutilvalidationreact poselinewrapstatelessbeanstalkidpopmotiontaskarraypushMicrosoftfastapitape$.extendtrimStartes-abstractroutefsuuidimmerarraybufferECMAScript 2015defineyamllocationes5vpcflattenargumentswalkingoffsetrequireassertionqueueMicrotaskregularapolloregular expressionsebsCSSsettingsbddemojiupspeedenumerablelaunchwordbreakRFC-6455String.prototype.trimdataViewautoprefixericuredux-toolkitexpressiepromisessortmkdirargsvalidatemetadatagetintrinsicposedropes8Function.prototype.namematchesflagsuninstallimportresolvees6telephonecloudfrontpyyamlslotECMAScript 2023chaiindicatorownperformantpackage.jsonfunctionelectroninputflatMaptyped arraylanguageArray.prototype.flatMapcallbindminimalcreateloggerSetdebuggerwaapikarmadefinePropertyjapaneseidleES7testingrmES5takefolderfindduplexbusyglobalsmimekinesisURLSearchParamsi18nopenponyfilliampersistentcharsetyupkeylibphonenumbergetterObject.assignECMAScript 2020wordwrapes-shims__proto__limitednodespecboundhttpdragstringifypromisees2016deep-copymodulesjestformlengthcallsetPrototypeOfcopyjavascriptloadingstdlibrm -frajvhelpersArrayBuffer.prototype.slicematchAlljsdiffpostcsstouchES2015exeinstallerrfc4122workflowxdgfullwidthPromisegraphqlreact-testing-libraryextendObservablefilterredirectsharedarraybufferweaksetreduceropenerdeepcacheurllook-upconcurrencytimeFloat64Arraymake dirformattypedarraysES6scheme-validationcore-jstslibphonegetoptWebSocketspropertiesasthardlinksdebugpatchelbshamsetImmediatejsonpathRxhookspackagepackagespipettyESrapidarktypecall-bindfullgroupByenvcmdthroatvalueeast-asian-widthmimetypescurlcode pointsio-tsdeepcopyisConcatSpreadablewait
3.7.134

11 months ago

3.6.133

11 months ago

3.6.134

11 months ago

2.6.92

1 year ago

2.6.93

1 year ago

2.4.70

1 year ago

2.6.94

12 months ago

2.6.101

12 months ago

2.6.102

12 months ago

2.6.100

12 months ago

2.6.99

12 months ago

2.4.76

1 year ago

2.4.75

1 year ago

2.6.95

12 months ago

2.4.72

1 year ago

2.6.96

12 months ago

2.4.71

1 year ago

2.6.97

12 months ago

2.4.74

1 year ago

2.6.98

12 months ago

2.4.73

1 year ago

1.2.16

1 year ago

1.2.17

1 year ago

1.2.15

1 year ago

2.3.49

1 year ago

2.3.46

1 year ago

2.3.48

1 year ago

2.3.47

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

3.6.120

11 months ago

3.6.121

11 months ago

3.6.122

11 months ago

3.6.123

11 months ago

3.6.119

11 months ago

2.5.76

1 year ago

2.3.53

1 year ago

2.5.77

1 year ago

2.3.52

1 year ago

2.5.78

1 year ago

2.5.79

1 year ago

2.3.51

1 year ago

2.3.50

1 year ago

2.5.80

1 year ago

2.5.81

1 year ago

2.5.82

1 year ago

3.6.131

11 months ago

3.6.132

11 months ago

3.6.130

11 months ago

3.6.128

11 months ago

3.6.129

11 months ago

3.6.124

11 months ago

1.2.41

1 year ago

3.6.125

11 months ago

1.2.42

1 year ago

3.6.126

11 months ago

3.6.127

11 months ago

1.2.40

1 year ago

2.5.87

1 year ago

2.5.88

1 year ago

2.5.89

1 year ago

1.2.43

1 year ago

2.5.83

1 year ago

2.5.84

1 year ago

2.5.85

1 year ago

2.5.86

1 year ago

2.5.90

1 year ago

2.5.91

1 year ago

2.5.92

1 year ago

1.2.18

1 year ago

1.2.19

1 year ago

2.4.58

1 year ago

2.4.57

1 year ago

1.2.20

1 year ago

2.4.59

1 year ago

2.6.116

11 months ago

2.4.54

1 year ago

1.2.23

1 year ago

2.6.117

11 months ago

2.4.53

1 year ago

1.2.24

1 year ago

2.6.114

11 months ago

2.4.56

1 year ago

1.2.21

1 year ago

2.6.115

11 months ago

2.4.55

1 year ago

1.2.22

1 year ago

1.2.27

1 year ago

1.2.28

1 year ago

2.6.118

11 months ago

1.2.25

1 year ago

2.6.119

11 months ago

1.2.26

1 year ago

1.2.29

1 year ago

2.6.112

12 months ago

2.6.113

12 months ago

2.6.110

12 months ago

2.6.111

12 months ago

2.4.69

1 year ago

2.2.46

1 year ago

1.2.30

1 year ago

2.4.68

1 year ago

1.2.31

1 year ago

2.2.44

1 year ago

2.2.45

1 year ago

2.6.105

12 months ago

2.4.65

1 year ago

1.2.34

1 year ago

2.6.106

12 months ago

2.4.64

1 year ago

2.2.43

1 year ago

1.2.35

1 year ago

2.6.103

12 months ago

2.4.67

1 year ago

1.2.32

1 year ago

2.6.104

12 months ago

2.4.66

1 year ago

1.2.33

1 year ago

2.6.109

12 months ago

2.4.61

1 year ago

1.2.38

1 year ago

2.4.60

1 year ago

1.2.39

1 year ago

2.6.107

12 months ago

2.4.63

1 year ago

1.2.36

1 year ago

2.6.108

12 months ago

2.4.62

1 year ago

1.2.37

1 year ago

1.1.13

1 year ago

1.1.9

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.8

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago