Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

difference

miketheprogrammer10.6kMIT1.0.2

Calculate the difference of two arrays

array, difference, intersection, calc, calculations, set, vector

readme

difference

Calculate the difference of two arrays

browser support

npm install difference

simple api

difference = require('difference');

difference(arrA, arrB);

// Important notes.

[1] is the same as ['1'] for now. This was meant to be the simplest and fastest way of calculating difference between two arrays.

difference([1,2,'3'],[3,4,5])

//output = [1,2,4,5];