Creates an array of values corresponding to `paths` of `object`.
const object = { 'a': [{ 'b': { 'c': 3 } }, 4] }
at(object, ['a[0].b.c', 'a[1]'])
// => [3, 4]
Name | Type | Attribute | Description |
---|---|---|---|
object | The object to iterate over. | ||
paths | The property paths to pick. |
{ "comment": "/**\r\n * Creates an array of values corresponding to `paths` of `object`.\r\n *\r\n * @since 1.0.0\r\n * @category Object\r\n * @param {Object} object The object to iterate over.\r\n * @param {...(string|string[])} [paths] The property paths to pick.\r\n * @returns {Array} Returns the picked values.\r\n * @example\r\n *\r\n * const object = { 'a': [{ 'b': { 'c': 3 } }, 4] }\r\n *\r\n * at(object, ['a[0].b.c', 'a[1]'])\r\n * // => [3, 4]\r\n */", "meta": { "range": [ 468, 518 ], "filename": "at.js", "lineno": 18, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo", "code": { "id": "astnode100000134", "name": "at", "type": "FunctionDeclaration", "paramnames": [ "paths" ] } }, "description": "Creates an array of values corresponding to `paths` of `object`.", "since": "1.0.0", "tags": [ { "originalTitle": "category", "title": "category", "text": "Object", "value": "Object" } ], "params": [ { "type": { "names": [ "Object" ] }, "description": "The object to iterate over.", "name": "object" }, { "type": { "names": [ "string", "Array." ] }, "optional": true, "variable": true, "description": "The property paths to pick.", "name": "paths" } ], "returns": [ { "type": { "names": [ "Array" ] }, "description": "Returns the picked values." } ], "examples": [ "const object = { 'a': [{ 'b': { 'c': 3 } }, 4] }\r\rat(object, ['a[0].b.c', 'a[1]'])\r// => [3, 4]" ], "name": "at", "longname": "at", "kind": "function", "scope": "global", "___id": "T000002R000012", "___s": true, "filepath": "at.js" }