Set.prototype.toggle

Cyril Auburtin cyril.auburtin at gmail.com
Sat Oct 28 15:15:21 UTC 2017


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/d980b220/attachment.html>


More information about the es-discuss mailing list