I know it's possible to define a function this way:
x=y=>y*y
which corresponds to:
function x(y){ return y*y; }
But I was wondering, is it possible to extend this to two or more arguments?
i.e. x=y,z=>y+z or similar to correspond to function x(y,z){ return y*z; }
Is there a similar convention to the very first example that allows for two or more arguments? I know that the x=y,z=>y+z syntax isn't right as I get errors regarding the definitions of at least one of variables... So how can it be done, or rather... can it be done??
yes try
x=(z,y)=>z*y
haha :D http://jsfiddle.net/FaSv2/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With