has-util
v1.0.2
Published
Check if an object has a given key.
Downloads
18
Maintainers
Readme
has-util
Check if an object has a given key.
Inspired by _.has
. 😄
Install
Install with npm
$ npm install has-util
Or unpkg
<script src="https://unpkg.com/[email protected]/umd/index.js" />
Check out the unit tests on CodePen.
Usage
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 | ➡ | | | ----------------------------------------------------------------------------------------------------------------------------------------- | --- | --------------------------------------------------------------------------------------------------------------------- |
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