has-util
Version:
Check if an object has a given key.
58 lines (34 loc) • 1.29 kB
Markdown
# has-util 
> Check if an object has a given key.
Inspired by `_.has`. 😄
## Install
Install with [npm](https://npmjs.org/package/has-util)
```
$ npm install has-util
```
Or [unpkg](https://unpkg.com/has-util/)
```
<script src="https://unpkg.com/has-util@1.0.0/umd/index.js" />
```
Check out the unit tests on [CodePen](https://codepen.io/jonkemp/full/vYObWNL).
## Usage
```js
const has = require('has-util');
has({a: 1, b: 2, c: 3}, 'b');
//=> true
```
---
| **Like us a lot?** Help others know why you like us! **Review this package on [pkgreview.dev](https://pkgreview.dev/npm/has-util)** | ➡ | [](https://pkgreview.dev/npm/has-util) |
| ----------------------------------------------------------------------------------------------------------------------------------------- | --- | --------------------------------------------------------------------------------------------------------------------- |
## API
### has(object, key)
#### object
Type: `objecct`
Default: `none`
The objecct to look in.
#### key
Type: `string`
Default: `none`
The key to search for.
## License
MIT