Native Function Composition

Simon Staton simon.staton at
Thu Aug 24 16:04:33 UTC 2017

I'm not sure if this has been proposed before, if not I would like to
propose a native way to handle function composition.

This is not that trivial, it can be achieved via a generic utility however
considering this is quite a common pattern it might make sense to include
it as a native feature set

Something along the lines of

Function.prototype.compose(); // chained at end of callstack


This could* A) *return a new function* B) *chain from the original reference

Quite often composition is not limited to a single function so it could be
a better approach to allow multiple arguments to be chained

Could also follow a similar design as the Java implementation

Simon Staton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list