is-array-elem
v1.0.2
Published
Checks if value is found in array
Downloads
12
Maintainers
Readme
is-array-elem
Checks if value is found in array, using SameValueZero
Installation
npm install --save is-array-elem
Usage
const isArrayElem = require('is-array-elem');
isArrayElem(['foo', 'bar'], 'foo');
//=> true
isArrayElem(['foo', 'bar'], 'bar');
//=> true
isArrayElem(['foo', 'bar'], 'baz');
//=> false
API
isArrayElem(array, value)
Parameters
| Name | Type | Description |
| ---- | ---- | ----------- |
| array | Array
| Array to inspect |
| value | *
| Value to search for |
Returns
Boolean
Related
- lodash.indexof - Gets the index of value in array
License
MIT © Lufty Wiranda