Lodash _.at() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Object

Definition

Creates an array of values corresponding to paths of object. Pluck several nested fields in one call. Since Lodash 1.0.0.

Pass the object and path or keys shown below. Check whether the helper mutates or returns a new object.

Syntax

Call _.at. Start with this line.

Lodash
_.at(object, ...paths)
CallWhat it does
_.at(object, ...paths)Primary signature.
_.at(object)Work with an object’s keys, values, or paths.

Prefer import at from "lodash/at" when you want a smaller bundle.

Library declarations
Lodash
_.at(object, ...paths)

Parameters

ParameterDescription
objectRequired. Object to read from
...pathsRequired. Property paths (strings or path arrays)

Return Value

Return ValueDescription
*Array of picked values (same order)

Lodash Examples

Example 1 — Official: Nested Paths

Pluck deep values with bracket and dotted paths.

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

_.at(object, ["a[0].b.c", "a[1]"]);
// → [3, 4]
Try It Yourself

How It Works

  1. object.a is an array of two items.
  2. First path walks into a[0].b.c → 3.
  3. Second path reads a[1] → 4.
  4. Result. Values appear in the same order as the paths.

Example 2 — Rest-Style vs Array of Paths

Both calling styles produce the same array.

Lodash
var user = { name: "Ada", profile: { city: "London" } };

_.at(user, "name", "profile.city");
// → ["Ada", "London"]

_.at(user, ["name", "profile.city"]);
// → ["Ada", "London"]
Try It Yourself

How It Works

  1. Rest form passes each path as its own argument.
  2. Array form passes one array of path strings.
  3. Same order → same result array.
  4. Tip. Use an array when paths come from a variable.

Example 3 — Missing Paths Are undefined

Slots stay aligned even when a path does not resolve.

Lodash
var object = { a: 1 };

_.at(object, ["a", "b.c", "a"]);
// → [1, undefined, 1]
Try It Yourself

How It Works

  1. Path "a" resolves to 1.
  2. Path "b.c" is missing → undefined.
  3. Third path reads a again → 1.
  4. Length always matches the number of paths.

Example 4 — vs _.get and _.pick

Choose by return shape: value, array, or object.

Lodash
var user = { name: "Ada", age: 36 };

_.get(user, "name");
// → "Ada"

_.at(user, ["name", "age"]);
// → ["Ada", 36]

_.pick(user, ["name", "age"]);
// → { name: "Ada", age: 36 }
Try It Yourself

How It Works

  1. get → one value (or default).
  2. at → ordered array of values.
  3. pick → new object with those keys.
  4. Pick at when you want to destructure: var [n, a] = _.at(…).

Example 5 — Key Name Contains a Dot

Use an array path so the key is not split on ..

Lodash
var object = { "a.b": 1, a: { b: 2 } };

_.at(object, "a.b");
// → [2]   // walks a → b

_.at(object, [["a.b"]]);
// → [1]   // literal key "a.b"
Try It Yourself

How It Works

  1. String "a.b" means nested path a then b.
  2. [["a.b"]] treats "a.b" as one property name.
  3. Results differ because the object has both shapes.
  4. Rule. Prefer array paths for unusual key names.

Browser & Runtime Support

_.at is a Lodash Object helper (since 1.0.0). It runs anywhere Lodash 4.x runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash.

✓ Stable · Lodash 1.0.0+

_.at()

Available in [email protected] full builds and the lodash/at modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.

100% With Lodash 4.x
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
_.at Lodash 1.0.0+

Bottom line: Safe for production once Lodash is loaded. Prefer import at from "lodash/at". Use _.get for one path with a default, or _.pick when you need an object.

Frequently Asked Questions

_.at(object, ...paths) creates an array of values corresponding to paths of object. Each result slot matches the path at the same index.
_.get reads one path and returns that value (or a default). _.at reads one or many paths and always returns an array.
_.pick returns a new object of selected keys. _.at returns an array of values in path order — handy for destructuring.
The matching array slot is undefined. The result length still equals the number of paths.
Yes — pass an array path segment, e.g. _.at(obj, [["weird.key"]]), so the key is not split on dots.
Use import at from "lodash/at" or require("lodash/at"). Full build: import _ from "lodash" then _.at.

Next: _.create()

Create an object that inherits from another.

_.create() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

11 people found this page helpful