北斗短报文通信服务平台
This commit is contained in:
10
app/middleware/utils/getArr.js
Normal file
10
app/middleware/utils/getArr.js
Normal file
@@ -0,0 +1,10 @@
|
||||
// 截取数组元素,组成新数组并返回
|
||||
module.exports = (arr, start, end) => {
|
||||
let newArr = [];
|
||||
arr.forEach((element, index) => {
|
||||
if (index >= start && index <= end) {
|
||||
newArr.push(element);
|
||||
}
|
||||
});
|
||||
return newArr;
|
||||
};
|
||||
Reference in New Issue
Block a user