Closed

Description
🔎 Search Terms
is:issue set difference does not exist
🕗 Version & Regression Information
I tested this on the Nightly TypeScript version, 5.7, 5.6, etc.
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about
FAQ (For Issue Filers)
⏯ Playground Link
💻 Code
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/difference$0
const odds = new Set([1, 3, 5, 7, 9]);
const squares = new Set([1, 4, 9]);
console.log(odds.difference(squares)); // Set(3) { 3, 5, 7 }
🙁 Actual behavior
Property 'difference' does not exist on type 'Set<number>'.ts(2339)
TypeScript does not recognize the property.
🙂 Expected behavior
I expected TypeScript to recognize the property, since:
- MDN confirms it is widely available
- Add types for stage 3 "set methods" proposal #57228 and add types for set methods proposal #57230 seem to have accepted and merged this back in May.
Why is the compiler still showing that it isn't recognized?
Additional information about the issue
No response