Could someone explain the follow JavaScript's syntax:
const result = (x, y) => (z) => {
/* code area */
return something;
}
My assumptions:
- (x, y) => (z) is a call to function z
- (z) => { } is a call to whatever is inside { }
Questions:
If so, what would I expect to the code's flow?
e.g: z is called first then it returns values to the anonymous function (x, y) => ?
Is the parentheses required?
About accessing the variables x, y and z in the code area, is it possible?
Finally, could someone, please, give a basic example how to use/call this syntax.
If I missed something, you can find the full code (my syntax is a made up example) here or just ask me.
Thanks in advance!