{"action":"created","issue":{"url":"https://api.github.com/repos/caolan/highland/issues/195","labels_url":"https://api.github.com/repos/caolan/highland/issues/195/labels{/name}","comments_url":"https://api.github.com/repos/caolan/highland/issues/195/comments","events_url":"https://api.github.com/repos/caolan/highland/issues/195/events","html_url":"https://github.com/caolan/highland/issues/195","id":54617658,"number":195,"title":"_.pick Returns Keys Not Present And Assigns 'undefined' To Them","user":{"login":"svozza","id":8573472,"avatar_url":"https://avatars.githubusercontent.com/u/8573472?v=3","gravatar_id":"","url":"https://api.github.com/users/svozza","html_url":"https://github.com/svozza","followers_url":"https://api.github.com/users/svozza/followers","following_url":"https://api.github.com/users/svozza/following{/other_user}","gists_url":"https://api.github.com/users/svozza/gists{/gist_id}","starred_url":"https://api.github.com/users/svozza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svozza/subscriptions","organizations_url":"https://api.github.com/users/svozza/orgs","repos_url":"https://api.github.com/users/svozza/repos","events_url":"https://api.github.com/users/svozza/events{/privacy}","received_events_url":"https://api.github.com/users/svozza/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-01-16T19:55:34Z","updated_at":"2015-01-19T00:59:00Z","closed_at":null,"body":"Not sure if this is expected behaviour or not (the test indicate it is) but if you use _.pick on a stream of objects and one of the keys you're looking for isn't present, the key still appears in the filtered stream but with the value `undefined` instead. For example,\r\n\r\n```javascript\r\n_([{ name: 'Test', id: 1234 }]).pick(['name', 'blah']).toArray(console.log)\r\n// => [{ id: 1234, blah: undefined }]\r\n```\r\n\r\nI would have expected this output:\r\n\r\n```javascript\r\n// => [{ id: 1234}]\r\n```\r\n\r\nIt also has the strange side effect where if none of the keys you are looking for are found then the objects returned are not empty like with lodash or Ramda:\r\n\r\n```javascript\r\nvar R = require('ramda')\r\nR.pick(['blah'], { name: 'Test', id: 1234})\r\n// => {}\r\n```\r\nThis makes it harder to filter out unwanted elements because you can't do something like this:\r\n\r\n```javascript\r\n_([{ name: 'Test', id: 1234 }, {name: 'Test'}]).pick(['id']).filter(R.isEmpty).toArray(console.log)\r\n```\r\nI have a pull request done for this and ready to submit if no one has any objections. Even if we don't change it, we should at least document the behaviour because it's a bit unusual.\r\n"},"comment":{"url":"https://api.github.com/repos/caolan/highland/issues/comments/70435317","html_url":"https://github.com/caolan/highland/issues/195#issuecomment-70435317","issue_url":"https://api.github.com/repos/caolan/highland/issues/195","id":70435317,"user":{"login":"vqvu","id":6435429,"avatar_url":"https://avatars.githubusercontent.com/u/6435429?v=3","gravatar_id":"","url":"https://api.github.com/users/vqvu","html_url":"https://github.com/vqvu","followers_url":"https://api.github.com/users/vqvu/followers","following_url":"https://api.github.com/users/vqvu/following{/other_user}","gists_url":"https://api.github.com/users/vqvu/gists{/gist_id}","starred_url":"https://api.github.com/users/vqvu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vqvu/subscriptions","organizations_url":"https://api.github.com/users/vqvu/orgs","repos_url":"https://api.github.com/users/vqvu/repos","events_url":"https://api.github.com/users/vqvu/events{/privacy}","received_events_url":"https://api.github.com/users/vqvu/received_events","type":"User","site_admin":false},"created_at":"2015-01-19T00:59:00Z","updated_at":"2015-01-19T00:59:00Z","body":"`pickBy` sounds reasonable if you have a use-case for it."}}