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

https://github.com/xotic750/array-difference-x

Creates an array of array values not included in the other given arrays.
https://github.com/xotic750/array-difference-x

array browser difference javascript nodejs

Last synced: 7 months ago
JSON representation

Creates an array of array values not included in the other given arrays.

Awesome Lists containing this project

README

          


Travis status


Dependency status


devDependency status


npm version


jsDelivr hits


bettercodehub score


Coverage Status

## array-difference-x

Creates an array of array values not included in the other given arrays.

### `module.exports(array, [...exclude])` ⇒ array

This method creates an array of array values not included in the other given
arrays using SameValueZero for equality comparisons. The order and references
of result values are determined by the first array.

**Kind**: Exported function
**Returns**: array - Returns the new array of filtered values.
**Throws**:

- TypeError If array is null or undefined.

| Param | Type | Description |
| ------------ | ------------------ | ---------------------- |
| array | array | The array to inspect. |
| [...exclude] | array | The values to exclude. |

**Example**

```js
import difference from 'array-difference-x';

console.log(difference([2, 1], [2, 3])); // => [1]
```