1.0.0 • Published 7 years ago

@f/union v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

union

Build status Git tag NPM version Code style

Compute the union of two arrays

Installation

$ npm install @f/union

Usage

var union = require('@f/union')

union([1, 2], [2, 3, 4]) // -> [1, 2, 3, 4]

API

union(a, b, cmp?)

  • a - First array
  • b - Second array
  • cmp - Optional. Comparator to use to reduce the joined array to its unique values.

Returns: Returns the logical union of the two arrays. That is, each unique element in either array, exactly once.

License

MIT