difference-with

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
3
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
1013 B
Finds the set (i.e. no duplicates) of all elements in the first list not contained in the second list.
1 contributor
Install difference-with as a package?
Copied
npm i @bit/justin-capalbo.ramda.difference-with
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
differenceWith (
pred:Function,
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. Duplication is determined according to the value returned by applying the supplied predicate to two list elements.

Example
const cmp = (x, y) => x.a === y.a;
     const l1 = [{a: 1}, {a: 2}, {a: 3}];
     const l2 = [{a: 3}, {a: 4}];
     R.differenceWith(cmp, l1, l2); //=> [{a: 1}, {a: 2}]
Arguments
pred: Function

A predicate used to test whether two items are equal.

list1: Array

The first list.

list2: Array

The second list.

Returns
Array

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

Help and resources