UNPKG

com-tools

Version:

com-tools 提供了一些通用的工具函数;

86 lines (40 loc) 956 B
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [com-tools](./com-tools.md) &gt; [moveItemsInArray](./com-tools.moveitemsinarray.md) ## moveItemsInArray() function 批量移动数组的元素,会改变原数组 **Signature:** ```typescript export declare function moveItemsInArray<Item>(arr: Item[], froms: number[], tos: number[]): Item[]; ``` ## Parameters <table><thead><tr><th> Parameter </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td> arr </td><td> Item\[\] </td><td> </td></tr> <tr><td> froms </td><td> number\[\] </td><td> </td></tr> <tr><td> tos </td><td> number\[\] </td><td> </td></tr> </tbody></table> **Returns:** Item\[\] 原数组对象 ## Remarks 将数组中的元素 从 from 移动到 to from 与 to 中的索引一一对应