Check if value is found in array, using SameValueZero
npm install --save is-array-elem
const isArrayElem = require('is-array-elem');
isArrayElem(['foo', 'bar'], 'bar');
//=> true
isArrayElem(['foo', 'bar'], 'baz');
//=> false
isArrayElem(['foo', 'bar'], 'foo');
//=> true
Name | Type | Description |
---|---|---|
array | Array |
Array to inspect |
value | * |
Value to search for |
Boolean
- lodash.indexof - Gets the index of value in array
MIT © Lufty Wiranda