I know that you can 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 expand to two or more arguments?
i.e. x=y,z=>y+zor similar, appropriatefunction x(y,z){ return y*z; }
Is there a similar convention for the very first example that allows two or more arguments? I know that the syntax is x=y,z=>y+zincorrect, because I get errors regarding the definitions of at least one of the variables ... So how can this be done, or rather ... can this be done?
source
share