Cyril Auburtin (2017-10-28T19:56:49.000Z)
extending Set is possible

```js
class SetWithToggle extends Set {
toggle(value, force = !this.has(value)) {
if (force) {
this.add(value);
} else {
this.delete(value);
}
return this;
}
};
```

2017-10-28 17:15 GMT+02:00 Cyril Auburtin <cyril.auburtin at gmail.com>:

> It would help to avoid this scenario:
> ```js
> if (cond) {
>   set.add(x);
> } else {
>   set.delete(x);
> }
> // set.toggle(x, cond);
> ```
>
> It's similar to Element's classList
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20171028/487ef7e1/attachment.html>
cyril.auburtin at gmail.com (2017-10-29T10:59:09.375Z)
extending Set is possible

```js
class SetWithToggle extends Set {
  toggle(value, force = !this.has(value)) {
    if (force) {
      this.add(value);
    } else {
      this.delete(value);
    }
    return this;
  }
}
```

2017-10-28 17:15 GMT+02:00 Cyril Auburtin <cyril.auburtin at gmail.com>: