union.js 316 B

123456789
  1. import restArguments from './restArguments.js';
  2. import uniq from './uniq.js';
  3. import flatten from './_flatten.js';
  4. // Produce an array that contains the union: each distinct element from all of
  5. // the passed-in arrays.
  6. export default restArguments(function(arrays) {
  7. return uniq(flatten(arrays, true, true));
  8. });