Add basic arithmetic to Math
allen at wirfs-brock.com
Mon Jun 11 08:17:53 PDT 2012
On Jun 10, 2012, at 11:48 AM, Angus Croll wrote:
> Would be handy/elegant/instructive to be able to write
> Moreover having functional versions of arithmetic operators would improve the currying/partial/composition experience.
> 1. Arrow functions work pretty well too:
These seems better, non-invasive approach rather than than adding built-in functions corresponding to every built-in operator.
Also, nothing preventing somebody from creating a library of such functions.
> 2. If add and multiply accepted multiple args, reduce would not be necessary for these cases:
> Math.add.apply(null, arr);
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss