Selectone.select()

select item in a list

Usage

Hover over inputs/exits for more info.

var Selectone = require('machinepack-selectone');


// select item in a list

Selectone.select({

array: [ 0, 1, 2, 3 ],

index: 2,

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

array required

The array to select

[ 0, 1, 2, 3 ]
index required

The index of the item in array is selected

2

Exits

error

An unexpected error occurred.

success

OK.

2