at source npm

_.at(object, [paths])

Creates an array of values corresponding to paths of object.

Arguments

  1. object (Object)

    The object to iterate over.

  2. [paths] (...(string|string[])

    The property paths of elements to pick, specified individually or in arrays.

Returns (Array)

Returns the new array of picked elements.

Example

var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };

_.at(object, ['a[0].b.c', 'a[1]']);
// => [3, 4]

_.at(['a', 'b', 'c'], 0, 2);
// => ['a', 'c']