Function constants for Identity and No-op

Andy Earnshaw andyearnshaw at
Wed Aug 10 11:53:24 UTC 2016

On Wed, 10 Aug 2016 at 12:42 Michał Wadas <michalwadas at> wrote:

> Function.prototype is no-op (run Function.prototype.toString() for more
> information)

That's true, but using `Function.prototype` can be confusing when passed to
a function as a callback:


It's not immediately clear that `someFunc` is expecting a callback function
in this case, whereas `Function.NOOP` or `() => {}` are pretty obvious.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list