{"action":"created","issue":{"url":"https://api.github.com/repos/tjmehta/101/issues/74","labels_url":"https://api.github.com/repos/tjmehta/101/issues/74/labels{/name}","comments_url":"https://api.github.com/repos/tjmehta/101/issues/74/comments","events_url":"https://api.github.com/repos/tjmehta/101/issues/74/events","html_url":"https://github.com/tjmehta/101/issues/74","id":63346982,"number":74,"title":"proposal: groupBy","user":{"login":"tjmehta","id":640279,"avatar_url":"https://avatars.githubusercontent.com/u/640279?v=3","gravatar_id":"","url":"https://api.github.com/users/tjmehta","html_url":"https://github.com/tjmehta","followers_url":"https://api.github.com/users/tjmehta/followers","following_url":"https://api.github.com/users/tjmehta/following{/other_user}","gists_url":"https://api.github.com/users/tjmehta/gists{/gist_id}","starred_url":"https://api.github.com/users/tjmehta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjmehta/subscriptions","organizations_url":"https://api.github.com/users/tjmehta/orgs","repos_url":"https://api.github.com/users/tjmehta/repos","events_url":"https://api.github.com/users/tjmehta/events{/privacy}","received_events_url":"https://api.github.com/users/tjmehta/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-03-21T02:35:30Z","updated_at":"2015-03-23T09:00:26Z","closed_at":null,"body":"Should it work with reduce?\r\n```js\r\n[ \r\n  { foo: 'bar', bar: 'yo' }, \r\n  { foo: 'bar' }, \r\n  { foo: 'flux' }, \r\n  { foo: 'flux', qux: 100 }\r\n].reduce(groupBy('foo'), {});\r\n/* returns \r\n{\r\n  'bar': [\r\n    { foo: 'bar', bar: 'yo' },\r\n    { foo: 'bar' }\r\n  ],\r\n  'flux': [\r\n    { foo: 'flux' }, \r\n    { foo: 'flux', qux: 100 }\r\n  ]\r\n}\r\n*/\r\n```\r\nNote: It requires an initial value which makes it a less \"plug and play\".\r\n\r\nOr just \r\n\r\n```js\r\ngroupBy(arr, 'foo')\r\n```"},"comment":{"url":"https://api.github.com/repos/tjmehta/101/issues/comments/84897144","html_url":"https://github.com/tjmehta/101/issues/74#issuecomment-84897144","issue_url":"https://api.github.com/repos/tjmehta/101/issues/74","id":84897144,"user":{"login":"tjmehta","id":640279,"avatar_url":"https://avatars.githubusercontent.com/u/640279?v=3","gravatar_id":"","url":"https://api.github.com/users/tjmehta","html_url":"https://github.com/tjmehta","followers_url":"https://api.github.com/users/tjmehta/followers","following_url":"https://api.github.com/users/tjmehta/following{/other_user}","gists_url":"https://api.github.com/users/tjmehta/gists{/gist_id}","starred_url":"https://api.github.com/users/tjmehta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjmehta/subscriptions","organizations_url":"https://api.github.com/users/tjmehta/orgs","repos_url":"https://api.github.com/users/tjmehta/repos","events_url":"https://api.github.com/users/tjmehta/events{/privacy}","received_events_url":"https://api.github.com/users/tjmehta/received_events","type":"User","site_admin":false},"created_at":"2015-03-23T09:00:25Z","updated_at":"2015-03-23T09:00:25Z","body":"The initial value can be avoided it we accept that `[ ].reduce(groupBy('foo'));` will throw an error."}}