Socket
Socket
Sign inDemoInstall

arr-union

Package Overview
Dependencies
1
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    arr-union

Returns an array of unique values using strict equality for comparisons, maintaining the same order as the provided arrays .


Version published
Weekly downloads
14M
decreased by-3.16%
Maintainers
1
Install size
15.3 kB
Created
Weekly downloads
 

Package description

What is arr-union?

The arr-union npm package is designed to create an array of unique values, in order, from the provided arrays. It is particularly useful for combining arrays while removing duplicate entries efficiently.

What are arr-union's main functionalities?

Union of multiple arrays

This feature allows you to pass multiple arrays to the union function, which returns a new array that includes every unique element from the input arrays, preserving the order they appear in the input.

const union = require('arr-union');
let result = union([1, 2], [2, 3], [3, 4]);
console.log(result); // Output: [1, 2, 3, 4]

Other packages similar to arr-union

Readme

Source

arr-union NPM version

Returns an array of unique values using strict equality for comparisons, maintaining the same order as the provided arrays .

Install with npm

npm i arr-union --save

Usage

var last = require('array-last');

union(['a'], ['b', 'c'], ['d', 'e', 'f']);
//=> ['a', 'b', 'c', 'd', 'e', 'f']

Returns only unique elements:

union(['a', 'a'], ['b', 'c']);
//=> ['a', 'b', 'c']

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert
Released under the MIT license


This file was generated by verb on December 12, 2014. To update, run npm i -g verb && verb.

Keywords

FAQs

Last updated on 12 Dec 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc