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
fromnumber, 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.
tonumber
yes
The index of the new location.