array-movetoend

Moves an item the array to the end of the array.

Usage no npm install needed!

<script type="module">
  import arrayMovetoend from 'https://cdn.skypack.dev/array-movetoend';
</script>

README

array-movetoend Build Status

Moves an item the array at index to the end of the array.

Install

$ npm install --save array-movetoend

Usage

var moveToEnd = require('array-movetoend');
moveToEnd([1, 2, 3, 4], 1)
// => [1, 3, 4, 2]

API

moveToEnd(array, index)

Returns the modified array.

array

Type: array

The array to modify.

index

Type: index

Position where the item is.

License

MIT © Emil Johansson