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 --saveInstall with bower
bower install arr-diff --saveReturn 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']npm testJon Schlinkert
Other projects that I maintain:
- arr-flatten
- arrayify-compact
- compact-object
- delete
- for-in
- for-own
- has-any
- has-value
- is-number
- is-plain-object
- mixin-deep
- mixin-object
- object-length
- omit-empty
- reduce-object
Copyright (c) 2014 Jon Schlinkert
Released under the MIT license
This file was generated by verb on December 28, 2014.