81a6826a82f399073aea78f879e938b6f04670264b6983e703807feead269132dc60a923ad97d7a87730fc72d828925696c53978e0911cd51bbb97a8f2a84c 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # arr-diff [![NPM version](https://img.shields.io/npm/v/arr-diff.svg)](https://www.npmjs.com/package/arr-diff) [![Build Status](https://img.shields.io/travis/jonschlinkert/base.svg)](https://travis-ci.org/jonschlinkert/base)
  2. > Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.
  3. ## Install
  4. Install with [npm](https://www.npmjs.com/)
  5. ```sh
  6. $ npm i arr-diff --save
  7. ```
  8. Install with [bower](http://bower.io/)
  9. ```sh
  10. $ bower install arr-diff --save
  11. ```
  12. ## API
  13. ### [diff](index.js#L33)
  14. Return the difference between the first array and additional arrays.
  15. **Params**
  16. * `a` **{Array}**
  17. * `b` **{Array}**
  18. * `returns` **{Array}**
  19. **Example**
  20. ```js
  21. var diff = require('arr-diff');
  22. var a = ['a', 'b', 'c', 'd'];
  23. var b = ['b', 'c'];
  24. console.log(diff(a, b))
  25. //=> ['a', 'd']
  26. ```
  27. ## Related projects
  28. * [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten)
  29. * [array-filter](https://www.npmjs.com/package/array-filter): Array#filter for older browsers. | [homepage](https://github.com/juliangruber/array-filter)
  30. * [array-intersection](https://www.npmjs.com/package/array-intersection): Return an array with the unique values present in _all_ given arrays using strict equality… [more](https://www.npmjs.com/package/array-intersection) | [homepage](https://github.com/jonschlinkert/array-intersection)
  31. ## Running tests
  32. Install dev dependencies:
  33. ```sh
  34. $ npm i -d && npm test
  35. ```
  36. ## Contributing
  37. Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/arr-diff/issues/new).
  38. ## Author
  39. **Jon Schlinkert**
  40. + [github/jonschlinkert](https://github.com/jonschlinkert)
  41. + [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
  42. ## License
  43. Copyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert)
  44. Released under the MIT license.
  45. ***
  46. _This file was generated by [verb](https://github.com/verbose/verb) on Sat Dec 05 2015 23:24:53 GMT-0500 (EST)._