@ngard/tiny-difference
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/ngard__tiny-difference package

1.0.0 • Public • Published

tiny-difference

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


Syntax

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

Parameters

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

Return

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.

Example

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]

Readme

Keywords

Package Sidebar

Install

npm i @ngard/tiny-difference

Weekly Downloads

8

Version

1.0.0

License

MIT

Unpacked Size

11.3 kB

Total Files

8

Last publish

Collaborators

  • ngard