@f/difference

1.0.1 • Public • Published

difference

Build status Git tag NPM version Code style

Subtract one list from another

Installation

$ npm install @f/difference

Usage

var difference = require('@f/difference')

difference([1, 2, 3], [2, 3, 4]) // -> [1]
difference([1, 2], [3, 4])       // -> [1, 2]

API

difference(a, b, getKey)

  • a - The list to be subtracted from
  • b - The list to subtract from a
  • getKey - Optional key function for the items of both lists. If not passed, a much slower algorithm is used. It is highly recommended that you pass getKey.

Returns: The result of filtering the items in list a to contain only items not found in list b.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @f/difference

Weekly Downloads

9

Version

1.0.1

License

MIT

Last publish

Collaborators

  • f