union.js 349 B

1234567891011
  1. var restArguments = require('./restArguments.js');
  2. var uniq = require('./uniq.js');
  3. var _flatten = require('./_flatten.js');
  4. // Produce an array that contains the union: each distinct element from all of
  5. // the passed-in arrays.
  6. var union = restArguments(function(arrays) {
  7. return uniq(_flatten(arrays, true, true));
  8. });
  9. module.exports = union;