com-tools
Version:
com-tools 提供了一些通用的工具函数;
102 lines (47 loc) • 1.41 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [com-tools](./com-tools.md) > [array\_moveToUseTest](./com-tools.array_movetousetest.md)
## array\_moveToUseTest() function
moveToUseTest(toIndex, needMoveTest) 根据测试函数批量移动数组的元素
**Signature:**
```typescript
export declare function array_moveToUseTest<T, ThisValue = T[]>(array: T[], toIndex: number, needMoveTest: ArrayCallbackFun<ThisValue, T, any>, thisValue?: ThisValue): T[];
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
array
</td><td>
T\[\]
</td><td>
</td></tr>
<tr><td>
toIndex
</td><td>
number
</td><td>
: number 元素被移动到的新位置的索引
</td></tr>
<tr><td>
needMoveTest
</td><td>
[ArrayCallbackFun](./com-tools.arraycallbackfun.md)<!-- --><ThisValue, T, any>
</td><td>
: (currentValue,index,arr)=<!-- -->><!-- -->boolean 测试数组元素是否需要被移动的函数,返回 boolean 值,表示当前元素 currentValue 是否需要被移动;
</td></tr>
<tr><td>
thisValue
</td><td>
ThisValue
</td><td>
_(Optional)_
</td></tr>
</tbody></table>
**Returns:**
T\[\]
Array<Item> 被移动的元素的数组