{"action":"created","issue":{"url":"https://api.github.com/repos/lodash/lodash/issues/962","labels_url":"https://api.github.com/repos/lodash/lodash/issues/962/labels{/name}","comments_url":"https://api.github.com/repos/lodash/lodash/issues/962/comments","events_url":"https://api.github.com/repos/lodash/lodash/issues/962/events","html_url":"https://github.com/lodash/lodash/issues/962","id":57628822,"number":962,"title":"`delete` method for better FP","user":{"login":"barneycarroll","id":83627,"avatar_url":"https://avatars.githubusercontent.com/u/83627?v=3","gravatar_id":"","url":"https://api.github.com/users/barneycarroll","html_url":"https://github.com/barneycarroll","followers_url":"https://api.github.com/users/barneycarroll/followers","following_url":"https://api.github.com/users/barneycarroll/following{/other_user}","gists_url":"https://api.github.com/users/barneycarroll/gists{/gist_id}","starred_url":"https://api.github.com/users/barneycarroll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barneycarroll/subscriptions","organizations_url":"https://api.github.com/users/barneycarroll/orgs","repos_url":"https://api.github.com/users/barneycarroll/repos","events_url":"https://api.github.com/users/barneycarroll/events{/privacy}","received_events_url":"https://api.github.com/users/barneycarroll/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-13T17:33:52Z","updated_at":"2015-02-13T17:36:53Z","closed_at":"2015-02-13T17:36:53Z","body":"The fact that `delete` is an operator while `Array.prototype.splice` makes functional composition difficult. Would a delete method be viable?\r\n\r\nSomething like:\r\n```javascript\r\n_.delete = ( collection, key ) => {\r\n\tif( collection instanceof Array ){\r\n\t\treturn collection.splice( key, 1 );\r\n\t}\r\n\telse if( collection instanceof String ){\r\n\t\treturn collection.slice( 0, key ) + collection.slice( key + 1, collection.length );\r\n\t}\r\n\telse {\r\n\t\tdelete collection[ key ];\r\n\t\treturn collection;\r\n\t}\r\n}"},"comment":{"url":"https://api.github.com/repos/lodash/lodash/issues/comments/74293176","html_url":"https://github.com/lodash/lodash/issues/962#issuecomment-74293176","issue_url":"https://api.github.com/repos/lodash/lodash/issues/962","id":74293176,"user":{"login":"jdalton","id":4303,"avatar_url":"https://avatars.githubusercontent.com/u/4303?v=3","gravatar_id":"","url":"https://api.github.com/users/jdalton","html_url":"https://github.com/jdalton","followers_url":"https://api.github.com/users/jdalton/followers","following_url":"https://api.github.com/users/jdalton/following{/other_user}","gists_url":"https://api.github.com/users/jdalton/gists{/gist_id}","starred_url":"https://api.github.com/users/jdalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdalton/subscriptions","organizations_url":"https://api.github.com/users/jdalton/orgs","repos_url":"https://api.github.com/users/jdalton/repos","events_url":"https://api.github.com/users/jdalton/events{/privacy}","received_events_url":"https://api.github.com/users/jdalton/received_events","type":"User","site_admin":false},"created_at":"2015-02-13T17:36:53Z","updated_at":"2015-02-13T17:36:53Z","body":"We have a [_.remove](https://lodash.com/docs#remove) for arrays. I want to avoid \"remove\" for collections as that can be handled a couple different ways for objects (`delete` or nulling/undefining). For making this a mixin you can use:\r\n\r\n```\r\nvar _ = require('lodash').runInContext();\r\n_.mixin({ 'delete': ... });\r\n```"}}