Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

array-missing

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-missing

Call a function for every element from a given array that's missing from another array

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

array-missing unstable

Call a function for every element from a given array that's missing from another array

Usage

NPM

missing(expected, actual, [missed], [matched])

Checks every element in the expected array to see if it's present somewhere in the actual array.

If an element isn't found, missed(el, index) will be called, where el is the element that's missing and index is its index within expected. Otherwise, matched will be called with the same arguments.

For example:

var missing = require('array-missing')

missing([1, 2, 4, 8], [6, 1, 2, 5], function(el, i) {
  console.log('element:', el)
  console.log('index:', i)
})

// element: 4
// index: 2
// element: 8
// index: 3

License

MIT. See LICENSE.md for details.

Keywords

FAQs

Package last updated on 25 Sep 2014

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc