has-util

Check if an object has a given key.

Usage no npm install needed!

<script type="module">
  import hasUtil from 'https://cdn.skypack.dev/has-util';
</script>

README

has-util Build Status

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/has-util@1.0.0/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 âž¡ Review us 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