JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 18022965
  • Score
    100M100P100Q244523F
  • License

Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.

Package Exports

  • arr-diff

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 (arr-diff) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

arr-diff NPM version Build Status

Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.

Why another array difference lib? I wanted the fastest, correct implementation I could find.

Install with npm

npm i arr-diff --save

Install with bower

bower install arr-diff --save

Usage

diff

Return the difference between the first array and additional arrays.

  • a {Array}
  • b {Array}
  • returns: {Array}
var diff = require('{%= name %}');

var a = ['a', 'b', 'c', 'd'];
var b = ['b', 'c'];

console.log(diff(a, b))
//=> ['a', 'd']

Run tests

npm test

Author

Jon Schlinkert

Other javascript/node.js utils

Other projects that I maintain:

License

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


This file was generated by verb on December 28, 2014.