MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Set
Set - JavaScript | MDN
August 13, 2026 - A set-like object is an object that provides the following: A size property that contains a number. A has() method that takes an element and returns a boolean.
01:00
Set methods in JavaScript - YouTube
04:26
How to use Javascript SET method - YouTube
07:06
JavaScript Set Explained - YouTube
12:00
JavaScript for Beginners #14 - Sets - YouTube
13:13
FASTER JavaScript In 2025 With Sets - YouTube
14:58
#3. Set in JavaScript - Easy Explanation #javascript - YouTube
Telerik
telerik.com › blogs › understanding-utilizing-javascript-set-object
Understanding and Utilizing the JavaScript Set Object
February 2, 2024 - By leveraging the Set's built-in methods for adding, checking and removing values, developers can simplify their code and reduce the complexity of handling distinct values. Moreover, the Set object ensures uniqueness, maintains insertion order and provides efficient value existence checks, which makes it a powerful tool in specific use cases. A Map object in JavaScript ...
YouTube
youtube.com › watch
Sets in Javascript (Set Object) - YouTube
Similar to Arrays, a Set can be used to store a sequence of values in Javascript. However, a Set can only store unique values, meaning we cannot store duplic...
Published: December 24, 2017
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Set › has
Set.prototype.has() - JavaScript | MDN
const mySet = new Set(); mySet.add("foo"); console.log(mySet.has("foo")); // true console.log(mySet.has("bar")); // false const set = new Set(); const obj = { key1: 1 }; set.add(obj); console.log(set.has(obj)); // true console.log(set.has({ key1: 1 })); // false, because they are different object references console.log(set.add({ key1: 1 })); // now set contains 2 entries
DEV Community
dev.to › keevcodes › the-javascript-set-object-2f75
The JavaScript Set Object - DEV Community
June 27, 2019 - Set is an object that can store any type of JavaScript primitive (think booleans, strings, numbers here), but it will only store unique primitives. Wait... what??? That's awesome! Yeah, my fellow developer, yeah. Instead of using the filter method, all we have to do is pass our postTypes array into the Set object and wrap it into an array.
Medium
medium.com › @asierr › javascripts-set-methods-finally-native-set-operations-20fbca65ef65
JavaScript’s Set Methods: Finally, Native Set Operations! | by asierr.dev | Medium
March 6, 2025 - JavaScript developers have been hacking together workarounds for common Set operations like union, intersection, and difference for years. But that’s about to change! With ECMAScript 2024, JavaScript finally introduces native Set methods, making operations on unique value collections faster and easier than ever before.
i2tutorials
i2tutorials.com › home › javascript – tutorial › javascript-set
Javascript-Set | i2tutorials
January 8, 2021 - <!DOCTYPE html> <script> "use strict";globalThis.__codeBoxId = "p8hj2rbs3i"; let set = new Set(); let john = { name: "John" }; let pete = { name: "Pete" }; let mary = { name: "Mary" }; // visits, some users come multiple times set.add(john); set.add(pete); set.add(mary); set.add(john); set.add(mary); // set keeps only unique values alert( set.size ); // 3 for (let user of set) { alert(user.name); // John (then Pete and Mary) } </script>
Medium
medium.com › just-javascript-tutorials › new-js-set-methods-you-need-to-know-are-now-in-the-browser-510bd0d47a6e
New JS Set Methods You Need To Know Are Now in the Browser | by Dr. Derek Austin 🥳 | Just JavaScript Tutorials | Medium
September 4, 2024 - */ const mapaches1 = new Set(["Luna", "Apollo", "Orion", Apollo]) /** * Another Set of mapaches' names; the duplicate "Nova" will be removed… ... AI-Native Senior Full-Stack SWE · UI/UX Engineer · TypeScript specialist · 20+ years of SWE · BS & MS age 19 · Doctor of Physical Therapy · DoctorDerek.com ... Pro tutorials about just JavaScript: “vanilla JS” without frameworks, frontend JS, backend JS / Node.js, and the npm package ecosystem.
W3Schools
w3schools.com › jsref › jsref_obj_set.asp
JavaScript Set Reference
altKey (Mouse) altKey (Key) animationName bubbles button buttons cancelable charCode clientX clientY code ctrlKey (Mouse) ctrlKey (Key) currentTarget data defaultPrevented deltaX deltaY deltaZ deltaMode detail elapsedTime elapsedTime eventPhase inputType isTrusted key keyCode location metaKey (Mouse) metaKey (Key) newURL oldURL offsetX offsetY pageX pageY persisted propertyName relatedTarget relatedTarget screenX screenY shiftKey (Mouse) shiftKey (Key) target targetTouches timeStamp touches type which (Mouse) which (Key) view HTML Event Methods
Top answer 1 of 13
48
ES6 provides a native Set:
let s = new Set();
let a = {};
let b = {};
s.add(a);
console.log(s.has(a)); // true
console.log(s.has(b)); // false
Run code snippetEdit code snippet Hide Results Copy to answer Expand
2 of 13
26
Here's a mad suggestion ... key it on the result of JSON.stringify(object)