1.0.0 • Published 2 years ago

smmcat-sort v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

安装

npm install smmcat-sort

特征

该模块的所有指令采用的是深拷贝,并不会影响原数组内容

导入

const _sort = require('smmcat-sort');

排序

 let list = [3, 2, 5, 1, 6, 7, 4];
 // 从大到小排序
 console.log(_sort.sortMax(list));
 // 从小到大排序
 console.log(_sort.sortMin(list));

打乱数组

 let newList = _sort.disruptList([1, 2, 3, 4, 5, 6, 7, 8, 9]);
 // 将打乱数组顺序
 console.log(newList);

开源协议

ISC