JSPM

array-missing

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q12398F
  • License MIT

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

Package Exports

  • array-missing

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (array-missing) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.