{"id":19041980,"url":"https://github.com/writetome51/array-get-and-remove-duplicates","last_synced_at":"2026-04-19T02:02:17.309Z","repository":{"id":57169551,"uuid":"156668672","full_name":"writetome51/array-get-and-remove-duplicates","owner":"writetome51","description":"Removes and returns every extra instance of each array item","archived":false,"fork":false,"pushed_at":"2019-04-15T00:54:48.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-02T07:25:59.523Z","etag":null,"topics":["array-manipulations","javascript","remove","remove-duplicates","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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}},"created_at":"2018-11-08T07:41:32.000Z","updated_at":"2019-04-15T00:54:50.000Z","dependencies_parsed_at":"2022-09-13T22:40:19.938Z","dependency_job_id":null,"html_url":"https://github.com/writetome51/array-get-and-remove-duplicates","commit_stats":null,"previous_names":[],"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-duplicates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-get-and-remove-duplicates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-get-and-remove-duplicates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writetome51%2Farray-get-and-remove-duplicates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/writetome51","download_url":"https://codeload.github.com/writetome51/array-get-and-remove-duplicates/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","javascript","remove","remove-duplicates","typescript"],"created_at":"2024-11-08T22:33:39.667Z","updated_at":"2026-04-19T02:02:17.214Z","avatar_url":"https://github.com/writetome51.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# getAndRemoveDuplicates(array): any[]\n\nRemoves and returns every extra instance of unique items in `array`.   \nNOTICE:  The function will error if `array` contains an object.  \n'object' does not include arrays.  Arrays are OK.\n\n## Examples\n```\nlet arr = [1, 2, 3, 4, 1, 2, 3, 4, 5, 2];  \nlet duplicates = getAndRemoveDuplicates(arr);  \n// arr is now [1,2,3,4,5].  \n// duplicates is now [1,2,2,3,4]  \n// (In returned duplicates, identical items are always side-by-side)\n\nlet arr = [1, 2, ['a','b'], 9, 1, 2, 3, 4, ['a','b'], 1, 9, ['a','b']];  \nlet duplicates = getAndRemoveDuplicates(arr);  \n// arr is now [1, 2, ['a','b'], 9, 3, 4]  \n// duplicates is now [1, 1, 2, ['a','b'], ['a','b'], 9]\n\n// This will trigger error, because arr contains object:  \nlet arr = [1, 2, {prop:1}, 2, 3, 4];  \ngetAndRemoveDuplicates(arr); // Error!\n```\n\n\n## Installation\n`npm install  @writetome51/array-get-and-remove-duplicates`\n\n## Loading\n```\n// If using TypeScript:\nimport {getAndRemoveDuplicates} from '@writetome51/array-get-and-remove-duplicates';\n// If using ES5 JavaScript:\nvar getAndRemoveDuplicates = \n\trequire('@writetome51/array-get-and-remove-duplicates').getAndRemoveDuplicates;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwritetome51%2Farray-get-and-remove-duplicates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwritetome51%2Farray-get-and-remove-duplicates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwritetome51%2Farray-get-and-remove-duplicates/lists"}