Returns true if the element exists in the array
npm install @bemoje/arr-has
npm install --save @bemoje/arr-has
npm install --save-dev @bemoje/arr-has
import arrHas from '@bemoje/arr-has'
const arr = [1, 2, 3]
arrHas(arr, 2)
//=> true
arrHas(arr, 4)
//=> false
arrHas(arr, 'asd')
//=> false
Uses Jest to test module functionality. Run tests to get coverage details.
npm run test
true if the element exists in the array
-
arr
Array The array to search -
element
any The element to find