1.0.1 • Published 1 year ago

diff-between-arrays v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Diff Between Arrays

Given two arrays, it finds the items that were added and removed.

Installation

$ npm install diff-between-arrays

Usage

Example: adding a 4 and removing a 1 from [1, 2, 3].

const diff = arraysDiff([1, 2, 3], [2, 3, 4])
// { added: [4], removed: [1] }

Example: adding two 'B' to ['A'].

const diff = arraysDiff(['A'], ['A', 'B', 'B'])
// { added: ['B', 'B'], removed: [] }
1.0.1

1 year ago

1.0.0

1 year ago