Select.first()

Get the first elementement

Usage

Hover over inputs/exits for more info.

var Select = require('machinepack-select');


// Get the first elementement

Select.first({

collection: [],

shift: true,

both: true,

}).execSync();

Inputs

collection required

A collection

shift

A boolean to specify if use shift method

true
both

A boolean to specify if we also return the array

true

Exits

error

An unexpected error occurred.

emptyError

Empty collection.

success

OK.

(varies based on provided inputs)