跳到主要内容

prototype.at

_.prototype.at([paths])

此方法是 _.at 的封装器版本。

¥This method is the wrapper version of _.at.

新增于

¥Since

1.0.0

参数

¥Arguments

  1. [paths] (...(字符串|字符串[])):要选择的属性路径。

    ¥[paths] (...(string|string[])): The property paths to pick.

返回

¥Returns

(对象):返回新的 lodash 封装器实例。

¥(Object): Returns the new lodash wrapper instance.

示例

¥Example

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

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