I do not get what y(x) in the third line does
var x = 5;
var y = 1;
( (x, y)=>(y => y(x) + 1)(x => x * 3 + y) ) (x, y);
// returns 17
I suspect that the f(x) calls the arrow function on the right.
>Solution :
That:
(y => y(x) + 1)
is a lambda (an anonymous function) that takes a function y as an argument.
Its argument is:
(x => x * 3 + y)
Thus it is the same as:
((x => x * 3 + y)(x) + 1)
((x*3)+y)+1
and all this is part of a function ((x, y)=> …) which is applied with the arguments (5,1).