Skip to main content
Module

x/rambda/symmetricDifference.spec.js

Faster and smaller alternative to Ramda
Go to Latest
File
import { symmetricDifference } from './symmetricDifference'
test('symmetricDifference', () => { const list1 = [ 1, 2, 3, 4 ] const list2 = [ 3, 4, 5, 6 ] expect(symmetricDifference(list1)(list2)).toEqual([ 1, 2, 5, 6 ])
expect(symmetricDifference([], [])).toEqual([])})
test('symmetricDifference with objects', () => { const list1 = [ { id : 1 }, { id : 2 }, { id : 3 }, { id : 4 } ] const list2 = [ { id : 3 }, { id : 4 }, { id : 5 }, { id : 6 } ] expect(symmetricDifference(list1)(list2)).toEqual([ { id : 1 }, { id : 2 }, { id : 5 }, { id : 6 }, ])})