left-diff
v0.1.1
Published
An array utility to calculate differences amongs arrays. Support array & nested array with string/number data
Readme
Left diff
An array utility to calculate differences amongs arrays. Support array & nested array with string/number data
Installation
npm install left-diffUsage
leftDiff
returns a new array contains elements that are available in first array, but not in others
import { leftDiff } from 'left-diff'
leftDiff([1,2,3], [3,4,5])
// => [1,2]
leftDiff([1,2,3], [3,4,5], [1])
// => [2]leftDiffDeep
returns a new array contains elements that are available in first array, but not in others - with all nested values counted
import { leftDiffDeep } from 'left-diff'
leftDiffDeep([1,[2,3]], [3,4,5])
// => [1,2]
leftDiffDeep([1,2,3], [[3,4],5], [1])
// => [2]