Arrays.pluck()

List the values of a particular key from an array of dictionaries.

Usage

Hover over inputs/exits for more info.

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


// List the values of a particular key from an array of dictionaries.

Arrays.pluck({

array: [ {} ],

key: 'id',

}).execSync();

Inputs

array required

The array of dictionaries to iterate over.

[ {} ]
key required

The property to pluck from each dictionary.

'id'

Exits

error

An unexpected error occurred.

success

OK.

(varies based on provided inputs)