0
why function puzzle could be call with ()()
function puzzle(){ return function(){ console.log(arguments); } } puzzle('a','b','c')(1,2,3);
3 Answers
+ 2
Call the return of puzzle (which is a function) with arguments (1,2,3)
Long form:
Myfunc = puzzle()
Myfunc(1,2,3)
Welcome in the world of functional programming where functions are first class objects.
It is a bootcamp for each brain at the beginning. But some guys are addicted to it.
+ 1
Luise Chen đŻđđ»
0
@Oma Falk thanks, I got it, so the paremeters ('a','b','c') didn't pass to arguments in return. The function in return just take(1,2,3) as arguments