diff-between-arrays
v1.0.1
Published
Given two arrays, finds the items that were added and removed
Downloads
2
Readme
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: [] }