Socket
Socket
Sign inDemoInstall

array-differ

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    array-differ

Create an array with values that are present in the first input array but not additional ones


Version published
Weekly downloads
5.3M
increased by1.32%
Maintainers
1
Install size
4.34 kB
Created
Weekly downloads
 

Package description

What is array-differ?

The array-differ npm package is a simple utility that allows you to find the difference between two arrays, essentially returning elements that are present in the first array but not in the second. It is useful for filtering out unwanted elements when comparing lists.

What are array-differ's main functionalities?

Array Difference

This code sample demonstrates how to use array-differ to find the difference between two arrays. It filters out elements from the first array that are not present in the second array, returning [1] in this case.

[1, 2, 3].filter(element => !['2', '3', '4'].includes(element))

Other packages similar to array-differ

Readme

Source

array-differ

Create an array with values that are present in the first input array but not additional ones

Install

$ npm install array-differ

Usage

import arrayDiffer from 'array-differ';

arrayDiffer([2, 3, 4], [3, 50]);
//=> [2, 4]

API

arrayDiffer(input, ...values)

Returns a new array.

input

Type: unknown[]

values

Type: unknown[]

Arrays of values to exclude.


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Keywords

FAQs

Last updated on 10 Aug 2021

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