arr-different

1.0.2 • Public • Published

arr-different

使用 Commonjs 的形式写的简单模块。

arr-different 用于比较两个简单数组中不同元素都是有哪些。

使用

这个模块作为开发时依赖进行使用。

$ npm install arr-different --save-dev

引入该模块之后,直接使用方法进行比较。

// 参数必须是简单元素组成的数组
arrDiff([1,2,3], [2,3,4]);

最终生成的结果 :

[
  { ele: 1, diff: { left: "×", right: "" } },
  { ele: 4, diff: { left: "", right: "×" } }
]

其中 left 代表第一个参数的数组,right 代表第二个参数的数组。

最佳的使用方式,在使用 arrDiff 比较之前,最好去除数组中的重复元素

特别说明

也可以使用下面的安装方式,在 package.json 中加入下面的代码 :

"arr-different""https://github.com/negivup/arr-different.git"

然后再 npm install

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i arr-different

Weekly Downloads

0

Version

1.0.2

License

MIT

Last publish

Collaborators

  • negivup