1.0.4 • Published 6 years ago

@evio/intersect v1.0.4

Weekly downloads
3
License
-
Repository
github
Last release
6 years ago

intersect

区别2个数组的新增、相同、删除部分

Usage

npm install --save @evio/intersect

Run it

const intersect = require('@evio/intersect');
const a = [1,2,3,4];
const b = [2,3,6,7];
const result = intersect(a, b);

从数组a到数组b的变化结果:

{
  removes: [1,4],
  commons: [2,3],
  adds: [6,7]
}