{"id":19042021,"url":"https://github.com/writetome51/array-get-and-remove-adjacent-at","last_synced_at":"2026-05-16T15:34:53.371Z","repository":{"id":122062343,"uuid":"156295625","full_name":"writetome51/array-get-and-remove-adjacent-at","owner":"writetome51","description":"Function removes and returns adjacent array items beginning at specified index","archived":false,"fork":false,"pushed_at":"2021-11-02T05:52:47.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T03:36:00.572Z","etag":null,"topics":["array-manipulations","javascript","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-11-05T23:08:03.000Z","updated_at":"2021-11-02T05:52:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"97341893-df05-4622-905e-5b8c6342aa09","html_url":"https://github.com/writetome51/array-get-and-remove-adjacent-at","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/writetome51/array-get-and-remove-adjacent-at","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-get-and-remove-adjacent-at","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-get-and-remove-adjacent-at/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-get-and-remove-adjacent-at/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-get-and-remove-adjacent-at/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/writetome51","download_url":"https://codeload.github.com/writetome51/array-get-and-remove-adjacent-at/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-get-and-remove-adjacent-at/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33108193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","javascript","typescript"],"created_at":"2024-11-08T22:33:57.796Z","updated_at":"2026-05-16T15:34:53.353Z","avatar_url":"https://github.com/writetome51.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# getAndRemoveAdjacentAt\\\u003cT\\\u003e(\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;startingIndex: number,\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;howMany: number,\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;array: T[]\u003cbr\u003e): T[]\n\nBeginning at `startingIndex`, it removes and returns `howMany` adjacent items from `array`.  \n`startingIndex` can be positive or negative.  \nIntended as a replacement for Array.prototype.splice() when removing items from `array`.  \nThis does strict validation for all 3 parameters.\n\n\n## Examples\n```js\nlet arr = [1,2,3,4,5,6];\ngetAndRemoveAdjacentAt(1, 3, arr);\n// --\u003e [2,3,4]\n// arr is now [1,5,6]\n\narr = [1, 2, 3, 4, 5, 6, 7, 8];\ngetAndRemoveAdjacentAt(-4, 2, arr);\n// --\u003e [5,6]\n// arr is now [1,2,3,4,7,8].\n\narr = [1, 2, 3, 4, 5, 6];\ngetAndRemoveAdjacentAt(-2, 3, arr); // requesting 1 too many items.\n// Error: 'the array does not have enough items to fulfill your request'\n\ngetAndRemoveAdjacentAt(0, 1, []); // index 0 doesn't exist on empty array.\n// Error: 'The entered index is not valid.  Whether positive or negative, \n// it exceeds the index range of the array.'\n```\n\n## Installation\n`npm i  @writetome51/array-get-and-remove-adjacent-at`\n\n## Loading\n```js\nimport {getAndRemoveAdjacentAt} \n    from '@writetome51/array-get-and-remove-adjacent-at';\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwritetome51%2Farray-get-and-remove-adjacent-at","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwritetome51%2Farray-get-and-remove-adjacent-at","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwritetome51%2Farray-get-and-remove-adjacent-at/lists"}