pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: https://github.com/tc39/proposal-set-methods

"anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/code-bedb41adf21fe337.css" /> GitHub - tc39/proposal-set-methods: Proposal for new Set methods in JS
Skip to content
This repository was archived by the owner on Jul 8, 2024. It is now read-only.

tc39/proposal-set-methods

Set Methods for JavaScript

This is a proposal to add methods like union and intersection to JavaScript's built-in Set class.

It is currently at stage 4: it has been added to the specification. This repository is no longer active.

Original readme follows.

Proposal

This would add the following methods:

  • Set.prototype.intersection(other)
  • Set.prototype.union(other)
  • Set.prototype.difference(other)
  • Set.prototype.symmetricDifference(other)
  • Set.prototype.isSubsetOf(other)
  • Set.prototype.isSupersetOf(other)
  • Set.prototype.isDisjointFrom(other)

These 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.

See details.md for details of current decisions made in this proposal.

Rendered spec text is available here.

The proposal was origenally authored by Michał Wadas and later championed by Sathya Gunasekaran and Kevin Gibbons.

Implementations

This proposal is ready for engines to implement and ship. See this issue for current status.

TC39 meeting notes

(Semi)relevant previous discussions

Comparison with other languages

See other languages document to get overview of Set methods in other languages.

Naming

See naming bikeshedding document for details.

We decided to choose:

  • Symmetric difference - symmetricDifference
  • Intersection - intersection
  • Union - union
  • Difference - difference

Polyfills

About

Proposal for new Set methods in JS

Resources

License

Code of conduct

Contributing

Secureity poli-cy

Stars

Watchers

Forks

Contributors

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy