{"id":13451723,"url":"https://github.com/tc39/proposal-set-methods","last_synced_at":"2025-04-05T00:04:20.213Z","repository":{"id":44415131,"uuid":"59904484","full_name":"tc39/proposal-set-methods","owner":"tc39","description":"Proposal for new Set methods in JS","archived":false,"fork":false,"pushed_at":"2024-03-28T20:47:26.000Z","size":306,"stargazers_count":615,"open_issues_count":3,"forks_count":13,"subscribers_count":47,"default_branch":"main","last_synced_at":"2024-04-13T17:19:27.795Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://tc39.github.io/proposal-set-methods/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tc39.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":"2016-05-28T16:40:47.000Z","updated_at":"2024-05-12T20:32:41.792Z","dependencies_parsed_at":"2024-01-16T03:45:58.102Z","dependency_job_id":"96a70228-6e69-4bab-a0ea-54af0b2618da","html_url":"https://github.com/tc39/proposal-set-methods","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/tc39%2Fproposal-set-methods","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tc39%2Fproposal-set-methods/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tc39%2Fproposal-set-methods/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tc39%2Fproposal-set-methods/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tc39","download_url":"https://codeload.github.com/tc39/proposal-set-methods/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266563,"owners_count":20910836,"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":[],"created_at":"2024-07-31T07:01:00.500Z","updated_at":"2025-04-05T00:04:20.195Z","avatar_url":"https://github.com/tc39.png","language":"HTML","funding_links":[],"categories":["HTML"],"sub_categories":[],"readme":"# Set Methods for JavaScript\n\nThis is a proposal to add methods like union and intersection to JavaScript's built-in `Set` class.\n\n**It is currently at stage 4: it has been [added to the specification](https://github.com/tc39/ecma262/pull/3306). This repository is no longer active.**\n\nOriginal readme follows.\n\n## Proposal\n\nThis would add the following methods:\n\n  * `Set.prototype.intersection(other)`\n  * `Set.prototype.union(other)`\n  * `Set.prototype.difference(other)`\n  * `Set.prototype.symmetricDifference(other)`\n  * `Set.prototype.isSubsetOf(other)`\n  * `Set.prototype.isSupersetOf(other)`\n  * `Set.prototype.isDisjointFrom(other)`\n\nThese methods would all require their arguments to be a Set, or at least something which looks like a Set in terms of having a numeric `size` property as well as `keys` and `has` methods.\n\nSee [details.md](./details.md) for details of current decisions made in this proposal.\n\nRendered spec text is available [here](https://tc39.es/proposal-set-methods/).\n\nThe proposal was originally authored by [Michał Wadas](https://github.com/Ginden) and later championed by [Sathya Gunasekaran](https://github.com/gsathya) and [Kevin Gibbons](https://github.com/bakkot).\n\n## Implementations\n\nThis proposal is ready for engines to implement and ship. See [this issue](https://github.com/tc39/proposal-set-methods/issues/78) for current status.\n\n## TC39 meeting notes\n\n* [May 2018](https://github.com/tc39/notes/blob/8711614630f631cb51dfb803caa087bedfc051a3/meetings/2018-05/may-22.md#set-methods)\n* [January 2019](https://github.com/tc39/notes/blob/8711614630f631cb51dfb803caa087bedfc051a3/meetings/2019-01/jan-29.md#update-on-set-methods)\n* [March 2022](https://github.com/tc39/notes/blob/6f7e075341e435f22777b07a3ee5141442d2d8a7/meetings/2022-03/mar-31.md#extending-built-ins) - discussion of how to extend built-ins in general\n* [July 2022](https://github.com/tc39/notes/blob/6f7e075341e435f22777b07a3ee5141442d2d8a7/meetings/2022-07/jul-20.md#set-methods-how-to-access-properties-of-the-argument)\n* [September 2022](https://github.com/tc39/notes/blob/65a82252aa14c273082e7687c6712bb561bc087a/meetings/2022-09/sep-14.md#set-methods-part-iii)\n* [November 2022](https://github.com/tc39/notes/blob/36635060482b1b27bcaff3c950dd9f7b31492dab/meetings/2022-11/nov-30.md#set-methods)\n* [March 2023](https://github.com/tc39/notes/blob/604156b02e312ea2ebd119518fa383efdfb1e646/meetings/2023-03/mar-21.md#set-methods-what-to-do-about-intersection-order)\n* [July 2023](https://github.com/tc39/notes/blob/604156b02e312ea2ebd119518fa383efdfb1e646/meetings/2023-07/july-12.md#set-methods-deferring-callability-check--handling-negative-sizes)\n* [February 2024](https://github.com/tc39/notes/blob/604156b02e312ea2ebd119518fa383efdfb1e646/meetings/2024-02/feb-6.md#set-methods-bugfix-and-update)\n* [April 2024](https://github.com/tc39/notes/blob/HEAD/meetings/2024-04/april-08.md#set-methods-for-stage-4)\n\n## (Semi)relevant previous discussions\n\n* [proposal-rm-builtin-subclassing](https://github.com/tc39/proposal-rm-builtin-subclassing)\n* [Map#map and Map#filter](https://github.com/tc39/ecma262/pull/13)\n* [Map.prototype.map and Map.prototype.filter (spec) + Set](https://esdiscuss.org/notes/2014-11-19)\n* [Map: filter/map and more](https://esdiscuss.org/topic/map-filter-map-and-more)\n* [Original topic regarding this proposal](https://esdiscuss.org/topic/new-set-prototype-methods)\n* [Newer topic regarding this proposal](https://esdiscuss.org/topic/new-set-methods-again)\n\n\n## Comparison with other languages\n\nSee [other languages document](./other-languages.md) to get overview of `Set` methods in other languages.\n\n## Naming\n\nSee [naming bikeshedding](./name-bikeshedding.md) document for details.\n\nWe decided to choose:\n\n* **Symmetric difference** - **`symmetricDifference`**\n* **Intersection** - **`intersection`**\n* **Union** - **`union`**\n* **Difference** - **`difference`**\n\n## Polyfills\n\n - [core-js](https://github.com/zloirock/core-js#new-set-methods)\n - [es-shims](https://github.com/es-shims):\n   - [difference](https://npmjs.com/set.prototype.difference)\n   - [intersection](https://npmjs.com/set.prototype.intersection)\n   - [symmetricDifference](https://npmjs.com/set.prototype.symmetricdifference)\n   - [union](https://npmjs.com/set.prototype.union)\n   - [isDisjointFrom](https://npmjs.com/set.prototype.isdisjointfrom)\n   - [isSubsetOf](https://npmjs.com/set.prototype.issubsetof)\n   - [isSupersetOf](https://npmjs.com/set.prototype.issupersetof)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftc39%2Fproposal-set-methods","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftc39%2Fproposal-set-methods","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftc39%2Fproposal-set-methods/lists"}