Skip to content

Latest commit

 

History

History
44 lines (29 loc) · 1.15 KB

Readme.md

File metadata and controls

44 lines (29 loc) · 1.15 KB

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