includes

v2.1.2arrow_drop_down
v2.1.2
v2.1.1
v2.1.0
v2.0.9
v2.0.8
v2.0.6
v2.0.5
v2.0.1
v1.1.1
v1.1.0
v1.0.8
v1.0.5
STATUS
Passing
DOWNLOADS
1,263
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
499 B
check if value is include in array - javascript
1 contributor
Install includes as a package?
Copied
npm i @bit/joshk.jotils.includes
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
No preview available
modifieddraft
chevron_left
chevron_right
includes (
array:Array,
value:(string | number)
) : boolean

check if value is include in array

Examples
import { includes } from '@bit/joshk.jotils.includes'
export default includes([1, 2, 3], 1) // => true
import { includes } from '@bit/joshk.jotils.includes'
export default includes([1, 2, 3], 4) // => false
Arguments
array: Array

array of string or number

value: (string | number)

a value to check if is include

Returns
boolean

true or false if is include or not

Test Summary

includes return true when value is include in array

Pass

includes return false when value is not include in array

Pass
Help and resources