Set (initial support)Baseline · Widely available
Set objects store unique values of any type.
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jul 29, 2015. Widely available since Jan 29, 2018.
Browser support
DesktopChrome
1–37Not supported
38+Supportedsince Oct 7, 2014
Current: 155Edge
12+Supportedsince Jul 29, 2015
Current: 154Firefox
1–12Not supported
13+Supportedsince Jun 5, 2012
Current: 157Safari
1–7Not supported
8+Supportedsince Oct 16, 2014
Current: 27MobileChrome Android
18–37Not supported
38+Supportedsince Oct 8, 2014
Current: 155Firefox Android
4–10Not supported
14+Supportedsince Jun 26, 2012
Current: 157Safari iOS
1–7Not supported
8+Supportedsince Sep 17, 2014
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
Full syntax and examples are on MDN: Set.
Feature detection
JS · check before using
if (typeof Set !== "undefined") {
// Set is available
}Documentation (MDN)
Specification
Sub-features
Support for each part of the feature (16). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| Set | 38 | 12 | 13 | 8 | 38 | 14 | 8 |
| Set.@@iterator | 43 | 12 | 36 | 9 | 43 | 36 | 9 |
| Set.@@species | 51 | 13 | 41 | 10 | 51 | 41 | 10 |
| Set.Set | 38 | 12 | 13 | 8 | 38 | 14 | 8 |
| Set.Set.iterable_allowed | 38 | 12 | 13 | 9 | 38 | 14 | 9 |
| Set.Set.null_allowed | 38 | 12 | 37 | 9 | 38 | 37 | 9 |
| Set.add | 38 | 12 | 13 | 8 | 38 | 14 | 8 |
| Set.clear | 38 | 12 | 19 | 8 | 38 | 19 | 8 |
| Set.delete | 38 | 12 | 13 | 8 | 38 | 14 | 8 |
| Set.entries | 38 | 12 | 24 | 8 | 38 | 24 | 8 |
| Set.forEach | 38 | 12 | 25 | 8 | 38 | 25 | 8 |
| Set.has | 38 | 12 | 13 | 8 | 38 | 14 | 8 |
| Set.key_equality_for_zeros | 38 | 12 | 29 | 9 | 38 | 29 | 9 |
| Set.keys | 38 | 12 | 24 | 8 | 38 | 24 | 8 |
| Set.size | 38 | 12 | 19 | 8 | 38 | 19 | 8 |
| Set.values | 38 | 12 | 24 | 8 | 38 | 24 | 8 |