Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 312 Bytes

File metadata and controls

18 lines (12 loc) · 312 Bytes

@codewell/reorder-array

Reorder an array

Installation

npm install @codewell/reorder-array

Basic usage

import reorderArray from '@codewell/reorder-array';

reorderArray(['a', 'b', 'c'], 0, 2); // => ['b', 'c', 'a']
reorderArray(['a', 'b', 'c'], 2, 0); // => ['c', 'a', 'b']