Select.last()

Get the last element

Usage

Hover over inputs/exits for more info.

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


// Get the last element

Select.last({

collection: [],

pop: true,

both: true,

}).execSync();

Inputs

collection required

A collection

pop

A boolean to specify if use pop 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)