About 51 results
Open links in new tab
  1. Ways to create a Set in JavaScript? - Stack Overflow

    Dec 3, 2011 · In Eloquent JavaScript, Chapter 4, a set of values is created by creating an object and storing the values as property names, assigning arbitrary values (e.g. true) as property values. To …

  2. how to create a javascript Set with objects? - Stack Overflow

    Mar 27, 2020 · There isn't any way around it with Set. One thing I've done in a similar situation is loop through the array and create a dictionary (either with a JavaScript Object or Map), generating a …

  3. javascript - How can I sort an ES6 `Set`? - Stack Overflow

    Oct 12, 2015 · A set is not an ordered abstract data structure. A Set however always has the same iteration order - element insertion order [1], so when you iterate it (by an iterating method, by calling …

  4. v8 - Javascript Set creation performance - Stack Overflow

    May 31, 2024 · So creating a set by traversing the array, then traversing the set, will always be slower than directly traversing the array. This approach only might be worth it (for overall runtime) when the …

  5. javascript - Iterate over set elements - Stack Overflow

    May 6, 2013 · I have turned on the Chrome flag for experimental ECMAscript 6 features, one of which is Set. As I understand, the details of Set are broadly agreed upon by the spec writers. I create a set a …

  6. How to customize object equality for JavaScript Set

    Apr 21, 2015 · This original question asked for customizability of a Set comparison in order to support deep object comparison. This doesn't propose customizability of the Set comparison, but it directly …

  7. Set of objects in javascript - Stack Overflow

    May 31, 2017 · I'd like to have a set of objects in Javascript. That is, a data structure that contains only unique objects. Normally using properties is recommended, e.g. myset["key"] = true. However, I need ...

  8. How to map/reduce/filter a Set in JavaScript? - Stack Overflow

    Oct 20, 2015 · The cause of the lack of map / reduce / filter on Map / Set collections seem to be mainly conceptual concerns. Should each collection type in Javascript actually specify its own iterative …

  9. Set cookie and get cookie with JavaScript - Stack Overflow

    I'm trying to set a cookie depending on which CSS file I choose in my HTML. I have a form with a list of options, and different CSS files as values. When I choose a file, it should be saved to a co...

  10. JavaScript Array to Set - Stack Overflow

    Mar 10, 2015 · MDN references JavaScript's Set collection abstraction. I've got an array of objects that I'd like to convert to a set so that I am able to remove (.delete()) various elements by name: var array …