microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
98.27k stars 12.2k forks source link

ESNext Set methods #58329

Closed Renegade334 closed 2 weeks ago

Renegade334 commented 2 weeks ago

⚙ Compilation target

esnext

⚙ Library

esnext

Missing / Incorrect Definition

The ES2025 Set.prototype methods proposal has now reached Stage 4, and has been rolled out in V8 and javascriptcore.

Sample Code

const a = new Set([1,2,3]), b = new Set([2,3,4]);

a.union(b);
a.intersection(b);
a.difference(b);
a.symmetricDifference(b);
a.isSubsetOf(b);
a.isSupersetOf(b);
a.isDisjointFrom(b);

Documentation Link

https://tc39.es/proposal-set-methods/

IllusionMH commented 2 weeks ago

Duplicate of #57228