Arrays.indexOf()

Look up the first occurrence of the specified item and return its array index.

This machine uses deep equality (`_.isEqual()`) for comparison.

Usage

Hover over inputs/exits for more info.

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


// Look up the first occurrence of the specified item and return its array index.

Arrays.indexOf({

array: [ '*' ],

item: '*',

}).execSync();

Inputs

array required

The array to search in (i.e. "haystack")

[ '*' ]
item required

The value to search for (i.e. "needle")

'*'

Exits

error

An unexpected error occurred.

notFound

Array does not contain specified item.

success

OK.

8