You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/05-data-types/07-map-set/article.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -236,7 +236,7 @@ A [`Set`](mdn:js/Set) is a special type collection - "set of values" (without ke
236
236
237
237
Its main methods are:
238
238
239
-
- [`new Set(iterable)`](mdn:js/Set/Set) -- creates the set, and if an `iterable` object is provided (usually an array), copies values from it into the set.
239
+
- [`new Set([iterable])`](mdn:js/Set/Set) -- creates the set, and if an `iterable` object is provided (usually an array), copies values from it into the set.
240
240
- [`set.add(value)`](mdn:js/Set/add) -- adds a value, returns the set itself.
241
241
- [`set.delete(value)`](mdn:js/Set/delete) -- removes the value, returns `true` if `value` existed at the moment of the call, otherwise `false`.
242
242
- [`set.has(value)`](mdn:js/Set/has) -- returns `true` if the value exists in the set, otherwise `false`.
@@ -321,7 +321,7 @@ The differences from a regular `Object`:
321
321
322
322
Methods and properties:
323
323
324
-
- [`new Set(iterable)`](mdn:js/Set/Set) -- creates the set, with optional `iterable` (e.g. array) of values for initialization.
324
+
- [`new Set([iterable])`](mdn:js/Set/Set) -- creates the set, with optional `iterable` (e.g. array) of values for initialization.
325
325
- [`set.add(value)`](mdn:js/Set/add) -- adds a value (does nothing if `value` exists), returns the set itself.
326
326
- [`set.delete(value)`](mdn:js/Set/delete) -- removes the value, returns `true` if `value` existed at the moment of the call, otherwise `false`.
327
327
- [`set.has(value)`](mdn:js/Set/has) -- returns `true` if the value exists in the set, otherwise `false`.
0 commit comments