https://github.com/codewell/reorder-array
Set which element should be at the end of an array
https://github.com/codewell/reorder-array
Last synced: 30 days ago
JSON representation
Set which element should be at the end of an array
- Host: GitHub
- URL: https://github.com/codewell/reorder-array
- Owner: codewell
- License: mit
- Created: 2019-11-19T14:34:55.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T02:17:42.000Z (over 3 years ago)
- Last Synced: 2025-02-04T18:18:00.160Z (over 1 year ago)
- Language: JavaScript
- Size: 788 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @codewell/reorder-array
Reorder an array
## Installation
```
npm install @codewell/reorder-array
```
## Basic usage
```JavaScript
import reorderArray from '@codewell/reorder-array';
reorderArray(['a', 'b', 'c'], 0, 2); // => ['b', 'c', 'a']
reorderArray(['a', 'b', 'c'], 2, 0); // => ['c', 'a', 'b']
```