{"id":19041983,"url":"https://github.com/writetome51/array-get-and-remove-by-indexes","last_synced_at":"2026-05-18T03:02:57.621Z","repository":{"id":122062344,"uuid":"155514448","full_name":"writetome51/array-get-and-remove-by-indexes","owner":"writetome51","description":"Removes and returns items from array, identified by their indexes","archived":false,"fork":false,"pushed_at":"2021-05-02T16:05:48.000Z","size":52,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T17:05:04.509Z","etag":null,"topics":["array-manipulations","elements","javascript","remove","typescript"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/writetome51.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-31T07:12:29.000Z","updated_at":"2021-05-02T16:05:50.000Z","dependencies_parsed_at":"2023-07-22T18:01:13.372Z","dependency_job_id":null,"html_url":"https://github.com/writetome51/array-get-and-remove-by-indexes","commit_stats":null,"previous_names":["writetome51/array-get-and-remove-items"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-get-and-remove-by-indexes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-get-and-remove-by-indexes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-get-and-remove-by-indexes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-get-and-remove-by-indexes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/writetome51","download_url":"https://codeload.github.com/writetome51/array-get-and-remove-by-indexes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240100512,"owners_count":19747683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["array-manipulations","elements","javascript","remove","typescript"],"created_at":"2024-11-08T22:33:40.283Z","updated_at":"2025-10-09T16:13:38.893Z","avatar_url":"https://github.com/writetome51.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# getAndRemoveByIndexes\\\u003cT\\\u003e(\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;indexes: number[],\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;array: T[]\u003cbr\u003e): T[] \n\nRemoves and returns items, identified by their `indexes`,  from `array`.   \nNegative indexes not allowed.  \nItems are returned in ascending index-order: i.e, item with index 0 appears first.  \n\n## Examples\n```js\nlet arr = [10,20,30,40,50,60];\nlet removed = getAndRemoveByIndexes([3, 1], arr);\n// removed is now [20, 40].  arr is now [10, 30, 50, 60].\n\narr = ['he', 'llo', 'zz', 'gg', 'cc'];\nremoved = getAndRemoveByIndexes([4, 0], arr);\n//  removed is now ['he', 'cc'].  arr is ['llo', 'zz', 'gg']. \n\narr = [10,20,30,40,50,60];\nremoved = getAndRemoveByIndexes([1,3,5], arr);\n// removed is now [20, 40, 60].  arr is [10, 30, 50].\n\n// It can work with duplicate indexes, though the result may not be\n// what you wanted:\narr = ['he', 'llo', 'zz', 'gg', 'cc', 'aa'];\nremoved = getAndRemoveByIndexes([2, 3, 4, 4], arr);\n// removed is now ['zz', 'gg', 'aa', 'cc'].  arr is ['he', 'llo']\n\narr = ['he', 'llo', 'zz', 'gg', 'cc', 'aa'];\nremoved = getAndRemoveByIndexes([1, 1, 1], arr);\n// removed is now ['gg', 'zz', 'llo'].  arr is ['he', 'cc', 'aa']\n```\n\n\n## Installation\n`npm i  @writetome51/array-get-and-remove-by-indexes`\n\n\n## Loading\n```js\nimport {getAndRemoveByIndexes} \n\tfrom '@writetome51/array-get-and-remove-by-indexes';\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwritetome51%2Farray-get-and-remove-by-indexes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwritetome51%2Farray-get-and-remove-by-indexes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwritetome51%2Farray-get-and-remove-by-indexes/lists"}