lodash 中文文档 lodash 中文文档
英文官网 (opens new window)
GitHub (opens new window)
英文官网 (opens new window)
GitHub (opens new window)
  • 简介
  • 数组
  • 集合
  • 函数
  • 语言
  • 数学
  • 数字
  • 对象
  • Seq
  • 字符串
  • 实用函数
  • Properties

lodash.pick


Synopsis


  1. ``` js
  2. _.pick(object, [paths])
  3. ```

Creates an object composed of the picked object properties.

Since


0.1.0

Arguments


object (Object): The source object.
[paths] (...(string|string[])): The property paths to pick.

Returns


(Object): Returns the new object.

Example


  1. ``` js
  2. var object = { 'a': 1, 'b': '2', 'c': 3 };

  3. _.pick(object, ['a', 'c']);
  4. // => { 'a': 1, 'c': 3 }

  5. ```
Last Updated: 2023-05-15 20:35:46