<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [com-tools](./com-tools.md) &gt; [array\_moveTo](./com-tools.array_moveto.md)

## array\_moveTo() function

moveTo(toIndex, ...fromIndexs) 根据索引批量移动数组的元素

**Signature:**

```typescript
export declare function array_moveTo<T>(array: T[], toIndex: number, ...fromIndexs: number[]): 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>

fromIndexs


</td><td>

number\[\]


</td><td>


</td></tr>
</tbody></table>
**Returns:**

T\[\]

Array<Item> 被移动的元素的数组

