Arrays.slice()

Copy a sub-array of consecutive items from the specified array.

Usage

Hover over inputs/exits for more info.

var Arrays = require('machinepack-arrays');


// Copy a sub-array of consecutive items from the specified array.

Arrays.slice({

array: [ '*' ],

start: 2,

end: 5,

}).execSync();

Inputs

array required

The array to slice.

[ '*' ]
start required

The index of the first item to include in the new array.

2
end

The index of the last item to include in the new array.

5

Exits

error

An unexpected error occurred.

success

OK.

(varies based on provided inputs)