HEX
Server: nginx/1.24.0
System: Linux nowruzgan 6.8.0-57-generic #59-Ubuntu SMP PREEMPT_DYNAMIC Sat Mar 15 17:40:59 UTC 2025 x86_64
User: babak (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/dev/shahnamag/back-end/node_modules/has-own-prop/readme.md
# has-own-prop [![Build Status](https://travis-ci.org/sindresorhus/has-own-prop.svg?branch=master)](https://travis-ci.org/sindresorhus/has-own-prop)

> A safer `.hasOwnProperty()`

Shortcut for `Object.prototype.hasOwnProperty.call(object, property)`.

You shouldn't use `.hasOwnProperty()` as it won't exist on [objects created with `Object.create(null)`](https://stackoverflow.com/a/12017703/64949) or it can have been overridden.


## Install

```
$ npm install has-own-prop
```


## Usage

```js
const hasOwnProp = require('has-own-prop');

const object = Object.create(null);
object.unicorn = true;

object.hasOwnProperty('unicorn');
//=> 'TypeError: undefined is not a function'

hasOwnProp(object, 'unicorn');
//=> true
```