<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [com-tools](./com-tools.md) &gt; [moveItemInNewArray](./com-tools.moveiteminnewarray.md)

## moveItemInNewArray() function

移动数组的元素，不改变原数组

**Signature:**

```typescript
export declare function moveItemInNewArray<Item>(arr: Item[], from: number, to: 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>

from


</td><td>

number


</td><td>


</td></tr>
<tr><td>

to


</td><td>

number


</td><td>


</td></tr>
</tbody></table>
**Returns:**

Item\[\]

新的数组

## Remarks

将数组中的元素 从 from 移动到 to

