My ECMAScript 7 wishlist
Axel Rauschmayer
axel at rauschma.de
Thu Jun 5 16:20:09 PDT 2014
> * `Function.empty` - a standard empty function that can be used when you just want an empty function (IMHO, it indicates intent much better than other options toda).
Ironically, that’s what Function.prototype is. But using that object in that capacity is beyond confusing. I’d prefer a different name such as “noop” or “doNothing”; “empty” doesn’t feel right in the context of something executable.
Also, I don’t find using an empty arrow function too bad (to me, it looks quite intention-revealing):
```js
someAsyncMethod(() => {});
```
--
Dr. Axel Rauschmayer
axel at rauschma.de
rauschma.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140606/3fedfbf4/attachment.html>
More information about the es-discuss
mailing list