difference

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
3
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
3 KB
Finds the set (i.e. no duplicates) of all elements in the first list not contained in the second list.
1 contributor
Install difference as a package?
Copied
npm i @bit/justin-capalbo.ramda.difference
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
difference (
list1:Array,
list2:Array
) : Array

Finds the set (i.e. no duplicates) of all elements in the first list not contained in the second list. Objects and Arrays are compared in terms of value equality, not reference equality.

Example
R.difference([1,2,3,4], [7,6,5,4,3]); //=> [1,2]
     R.difference([7,6,5,4,3], [1,2,3,4]); //=> [7,6,5]
     R.difference([{a: 1}, {b: 2}], [{a: 1}, {c: 3}]) //=> [{b: 2}]
Arguments
list1: Array

The first list.

list2: Array

The second list.

Returns
Array

The elements in `list1` that are not in `list2`.

Help and resources