# has-own-property

> Check if an object has a local property.

Latest version **2.0.0** (published 2021-07-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install has-own-property
pnpm add has-own-property
yarn add has-own-property
bun add has-own-property
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2021-07-24 |
| First published | 2016-06-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | ^12.20.0 \|\| ^14.13.1 \|\| >=16.0.0 |
| Dependencies | 0 |
| Unpacked size | 2.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | linusu, flet |

## Links

- npm: https://www.npmjs.com/package/has-own-property
- Repository: https://github.com/LinusU/has-own-property
- Homepage: https://github.com/LinusU/has-own-property#readme
- Issues: https://github.com/LinusU/has-own-property/issues
- npm.io page: https://npm.io/package/has-own-property

## Recent versions

- 2.0.0 (latest) — 2021-07-24
- 1.0.0 — 2016-09-22
- 0.1.0 — 2016-06-03

## README

# Has Own Property?

Check if an object has a local property.

## Installation

```sh
npm install --save has-own-property
```

## Usage

```js
import hasOwnProperty from 'has-own-property'

const obj = { a: 1 }

hasOwnProperty(obj, 'a') // true
hasOwnProperty(obj, 'b') // false
```

## API

### `hasOwnProperty(object, name)`

- `object` (`object`, required)
- `name` (`string | number | symbol`, required)
- returns `boolean`

Determines whether an object has a property with the specified name.

---
_Source: https://npm.io/package/has-own-property · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
