Open this example in the interactive library
Source code
const entries: readonly (readonly [string, number])[] = [
["api", 2],
["web", 4],
];
console.log(
(() => {
const item = {};
const seen = new WeakSet<object>([item]);
return [seen.has(item), seen.has({})];
})(),
);
Sample output
[ true, false ]
