SHIFT + D

reorder

Updated on August 22, 2024Source codeTests

createReorder is a pipe that transforms an array to an array with one or more items moved to a new position.

Create reorder

Call createReorder with these parameters to create your reorder function:

Parameter
Type
Required
Description
from
number, Object
yes

The index (number) of the item to move.

Alternatively, you can pass an object with a start property and a itemCount property. In this case, your reorder function would start from the start index, collect itemCount items, and move them to the new location.

to
number
yes
The index of the new location.

removereplace

Edit doc on GitHub

ON THIS PAGE

reorderCreate reorder