Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cevio/intersect
intersect
https://github.com/cevio/intersect
Last synced: 4 days ago
JSON representation
intersect
- Host: GitHub
- URL: https://github.com/cevio/intersect
- Owner: cevio
- Created: 2018-01-24T10:00:55.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-09-29T07:50:46.000Z (about 6 years ago)
- Last Synced: 2024-08-09T08:25:04.361Z (3 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# intersect
区别2个数组的新增、相同、删除部分
# Usage
```bash
npm install --save @evio/intersect
```# Run it
```javascript
const intersect = require('@evio/intersect');
const a = [1,2,3,4];
const b = [2,3,6,7];
const result = intersect(a, b);
```从数组`a`到数组`b`的变化结果:
```javascript
{
removes: [1,4],
commons: [2,3],
adds: [6,7]
}
```