Skip to content
Agents tracked: 440 Downloads (7d): 202M down 19.5% GitHub stars: 10.4M Releases (7d): 607 Agent status: 3 with issuesSince last limit reset: Claude 28d · Codex 0d Updated Oct 21, 2026

Read nested values with _.at

_.at takes a list of property paths and returns the values found at each one, in the same order.

All Lodash examples Lodash: usage and stats

Read nested values with _.at: screenshot of the example below running
The code below, running in Chromium on our server (Oct 12, 2026). Press Run to see it live and change it.

How it works

  1. A method you can cherry-pick. at is one of the methods the docs show loading on its own; here it is called from the full build as _.at. [1]
  2. Pass an array of paths. Each path is a string using dots and brackets, such as 'user.address.city' or 'orders[0].total'. The result is an array of values in the same order. [2]
  3. Missing paths. The last lines ask for 'user.phone.mobile', a path that is not in the data, and print what comes back for it. [2]

Run and edit it

It runs in your browser, in a sandboxed frame that cannot see this site; the packages load from esm.sh only after you press Run.

import _ from 'lodash';

const data = {
  user: { name: 'Ada', address: { city: 'London', zip: 'N1 9GU' } },
  orders: [
    { id: 101, total: 42.5, items: ['book', 'pen'] },
    { id: 102, total: 18, items: ['mug'] },
  ],
};

const paths = ['user.name', 'user.address.city', 'orders[0].total', 'orders[1].items[0]'];
const values = _.at(data, paths);

console.log('picked', values.length, 'values:');
paths.forEach((p, i) => console.log(`  ${p.padEnd(20)} -> ${JSON.stringify(values[i])}`));

// Arrays work too: index paths
const letters = ['a', 'b', 'c', 'd'];
console.log('letters at [0], [2]:', JSON.stringify(_.at(letters, ['[0]', '[2]'])));

// A missing path yields undefined, no error
const [zip, phone] = _.at(data, ['user.address.zip', 'user.phone.mobile']);
console.log('zip:  ', zip);
console.log('phone:', phone);
Ctrl/⌘ + Enter runs

Free for signed-in members, with a daily limit. Describe the change in plain words; the new code runs only in your browser.

Add a path such as 'orders[1].items[0]' to the list and rerun. Code written by AgentGid [1].

Checked Oct 12, 2026: it starts without errors in Chromium with lodash 4.18.1. Needs WebGL.

More Lodash examples

Default values with _.defaults Split arrays with _.partition Iterate collections with Lodash Compose functions with Lodash

Sources

  1. Lodash README (GitHub)
  2. Lodash website

Explanations written by AgentGid from the official docs; the numbers in brackets point here. The code marked "written by AgentGid" is ours and free to copy.

Building something with Lodash? Ask AgentGid →