Jump to content

JavaScript: Difference between revisions

Line 215: Line 215:


===Set===
===Set===
[https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set MDN Set]
<syntaxhighlight lang="js">
let my_set = new Set();
// Returns the set itself
my_set.add(key);
my_set.has(key);
my_set.clear();
// Returns if key has in the set
my_set.delete(key);
</syntaxhighlight>


===WeakMap===
===WeakMap===