An open API service indexing awesome lists of open source software.

https://github.com/maxmellon/array-set

create array as set from two arrays. like as intersection, union, and defference set.
https://github.com/maxmellon/array-set

Last synced: 11 months ago
JSON representation

create array as set from two arrays. like as intersection, union, and defference set.

Awesome Lists containing this project

README

          

# array-set
> create array as set from two arrays. like as intersection, union, and defference set.

## Usage

```js
const { intersection, union, difference } = require("array-set");

union([3, 2, 3], [2, 3, 4]);
// => [3, 2, 4]
intersection([1, 2, 3], [3, 4, 5]);
// => [3]
difference([1, 2, 3, 4], [1, 2]);
// => [3, 4]
```

## API

### intersection: `(a: T[], b: T[]): T[]`

### union: `(a: T[], b: T[]): T[]`

### difference: `(a: T[], b: T[]): T[]`