{"action":"created","issue":{"url":"https://api.github.com/repos/lodash/lodash/issues/3038","repository_url":"https://api.github.com/repos/lodash/lodash","labels_url":"https://api.github.com/repos/lodash/lodash/issues/3038/labels{/name}","comments_url":"https://api.github.com/repos/lodash/lodash/issues/3038/comments","events_url":"https://api.github.com/repos/lodash/lodash/issues/3038/events","html_url":"https://github.com/lodash/lodash/issues/3038","id":210672841,"node_id":"MDU6SXNzdWUyMTA2NzI4NDE=","number":3038,"title":"_.get Documentation Update Proposal","user":{"login":"jdconner","id":12697946,"node_id":"MDQ6VXNlcjEyNjk3OTQ2","avatar_url":"https://avatars2.githubusercontent.com/u/12697946?v=4","gravatar_id":"","url":"https://api.github.com/users/jdconner","html_url":"https://github.com/jdconner","followers_url":"https://api.github.com/users/jdconner/followers","following_url":"https://api.github.com/users/jdconner/following{/other_user}","gists_url":"https://api.github.com/users/jdconner/gists{/gist_id}","starred_url":"https://api.github.com/users/jdconner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdconner/subscriptions","organizations_url":"https://api.github.com/users/jdconner/orgs","repos_url":"https://api.github.com/users/jdconner/repos","events_url":"https://api.github.com/users/jdconner/events{/privacy}","received_events_url":"https://api.github.com/users/jdconner/received_events","type":"User","site_admin":false},"labels":[{"id":9649680,"node_id":"MDU6TGFiZWw5NjQ5Njgw","url":"https://api.github.com/repos/lodash/lodash/labels/documentation","name":"documentation","color":"fbca04","default":false},{"id":2763157,"node_id":"MDU6TGFiZWwyNzYzMTU3","url":"https://api.github.com/repos/lodash/lodash/labels/wontfix","name":"wontfix","color":"ffffff","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-02-28T02:58:14Z","updated_at":"2018-12-27T14:55:38Z","closed_at":"2017-02-28T04:33:51Z","author_association":"NONE","body":"What\r\n-\r\nThe documentation for the `_.get` function does not fully portray its functionality.\r\n\r\nWhy\r\n-\r\nI've had to explain and show 4 people today that the `_.get` function works with arrays by pulling up the source code and giving examples in the console. This is a tell-tale sign of poor documentation for the function. \r\n\r\nProposal\r\n-\r\nWe should update the documentation for the `_.get` function to something along the lines of:\r\n```js\r\n import baseGet from './.internal/baseGet.js'\r\n\r\n/**\r\n * Gets the value at `path` of `object`. If the resolved value is\r\n * `undefined`, the `defaultValue` is returned in its place.\r\n *\r\n * @since 3.7.0\r\n * @category Object\r\n * @param {Object|Array} collection The collection to query.\r\n * @param {Array|string} path The path of the property to get.\r\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\r\n * @returns {*} Returns the resolved value.\r\n * @see has, hasIn, set, unset\r\n * @example\r\n * const array = [{ 'b': { 'c': 3 } }]\r\n * const object = { 'a': array }\r\n *\r\n * get(object, 'a[0].b.c')\r\n * // => 3\r\n *\r\n * get(object, ['a', '0', 'b', 'c'])\r\n * // => 3\r\n *\r\n * get(object, 'a.b.c', 'default')\r\n * // => 'default'\r\n *\r\n * get(array, 0)\r\n * // => { 'b': { 'c': 3 } }\r\n *\r\n * get(array, '[0].b')\r\n * // => { 'c': 3 }\r\n *\r\n * get(array, 1)\r\n * // => undefined\r\n */\r\nfunction get(object, path, defaultValue) {\r\n  const result = object == null ? undefined : baseGet(object, path)\r\n  return result === undefined ? defaultValue : result\r\n}\r\n\r\nexport default get\r\n```\r\nExample Explanations\r\n-\r\nThe examples within the new documentation will show that arrays can:\r\n- return resolved values when passed an index\r\n- return resolved values when passed a path\r\n- return `undefined` when passed an index that is out of bounds instead of throwing a runtime error\r\n\r\nP.S.\r\n-\r\nThis technically doesn't add new functionality since it is already implemented but does provide a feature to those who strictly adhere to documentation over reading source code. As documented, this codebase requires issues for features so here it is.\r\n\r\nI am willing to update tests and the documentation if this proposal is accepted. "},"comment":{"url":"https://api.github.com/repos/lodash/lodash/issues/comments/450165238","html_url":"https://github.com/lodash/lodash/issues/3038#issuecomment-450165238","issue_url":"https://api.github.com/repos/lodash/lodash/issues/3038","id":450165238,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MDE2NTIzOA==","user":{"login":"lock[bot]","id":33595554,"node_id":"MDM6Qm90MzM1OTU1NTQ=","avatar_url":"https://avatars1.githubusercontent.com/in/6672?v=4","gravatar_id":"","url":"https://api.github.com/users/lock%5Bbot%5D","html_url":"https://github.com/apps/lock","followers_url":"https://api.github.com/users/lock%5Bbot%5D/followers","following_url":"https://api.github.com/users/lock%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/lock%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/lock%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lock%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/lock%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/lock%5Bbot%5D/repos","events_url":"https://api.github.com/users/lock%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/lock%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2018-12-27T14:55:38Z","updated_at":"2018-12-27T14:55:38Z","author_association":"NONE","body":"This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.\n"}}
{"actor":{"display_login":"lock"}}