contains

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
2
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
2 KB
Returns `true` if the specified value is equal, in [`R.equals`](#equals) terms, to at least one element of the given list; `false` otherwise.
1 contributor
Install contains as a package?
Copied
npm i @bit/justin-capalbo.ramda.contains
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
chevron_left
chevron_right
contains (
a:Object,
list:Array
) : Boolean

Returns true if the specified value is equal, in R.equals terms, to at least one element of the given list; false otherwise. Works also with strings.

Example
R.contains(3, [1, 2, 3]); //=> true
     R.contains(4, [1, 2, 3]); //=> false
     R.contains({ name: 'Fred' }, [{ name: 'Fred' }]); //=> true
     R.contains([42], [[42]]); //=> true
     R.contains('ba', 'banana'); //=>true
Arguments
a: Object

The item to compare against.

list: Array

The array to consider.

Returns
Boolean

`true` if an equivalent item is in the list, `false` otherwise.

Help and resources