A minimal-weight lodash.difference equivalent utility

License: MIT

Language: JavaScript


source bundle size build status license

A minimal-weight utility identical to lodash.difference. For when every byte counts!

lodash.difference bundle size
tiny-difference bundle size


difference(/* array, [...arrays] */)


array - The array to calculate the difference to. Resulting array elements are in the same order as appear in this array
arrays - Any number of other arrays, whose elements will not appear in the returned array


A new array containing only the elements found in the first array and not in the other arrays, in the order as they appear in the first array.


import { difference } from '@ngard/tiny-difference';

const diff = difference([1,2,3,4], [1,2]); // returns [3,4]
const diff = difference([1,2,3,4], [1,2], [2,3,5]); // returns [4]

Project Statistics

Sourcerank 2
Repository Size 3.91 KB
Stars 0
Forks 0
Watchers 1
Open issues 0
Dependencies 37
Contributors 1
Tags 0
Last updated
Last pushed

Top Contributors See all

Nick G

Packages Referencing this Repo

A minimal-weight lodash.difference equivalent utility
Latest release 1.0.0 - Published

Something wrong with this page? Make a suggestion

Last synced: 2019-09-14 09:17:10 UTC

Login to resync this repository