Update formatting
This commit is contained in:
@ -7,7 +7,7 @@ lastUpdated: 2020-10-11T11:52:48+03:00
|
||||
|
||||
Creates a frozen `Set` object.
|
||||
|
||||
- Use the `new Set()` constructor to create a new `Set` object from `iterable`.
|
||||
- Use the `Set` constructor to create a new `Set` object from `iterable`.
|
||||
- Set the `add`, `delete` and `clear` methods of the newly created object to `undefined`, so that they cannot be used, practically freezing the object.
|
||||
|
||||
```js
|
||||
@ -21,6 +21,6 @@ const frozenSet = iterable => {
|
||||
```
|
||||
|
||||
```js
|
||||
frozenSet([1, 2, 3, 1, 2]);
|
||||
frozenSet([1, 2, 3, 1, 2]);
|
||||
// Set { 1, 2, 3, add: undefined, delete: undefined, clear: undefined }
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user