Arrays.nth()

Look up an item from the array at the specified index.

Usage

Hover over inputs/exits for more info.

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


// Look up an item from the array at the specified index.

Arrays.nth({

array: [ '*' ],

index: 2,

}).execSync();

Inputs

array required

The array containing the desired item.

[ '*' ]
index required

The index of the item to be gotten.

2

Exits

error

An unexpected error occurred.

notFound

The array doesn't have an item at the specified index.

success

OK.

(varies based on provided inputs)