Implement a function FN, so that the result of FN (1) (2) is two parameters of the and, at first did not react, in fact, carefully think of the second parenthesis is the function of the question of re-call, nonsense not to say, the code:
varfn =function(n) {functionF (m) {returnn +m; } returnf;//This must return the entire function, not the function's call F (); }; vars = fn (1) (2); Console.log (s);//or functionFN (n) {functionF (m) {returnn +m; } returnF; }; vars = fn (1) (2); Console.log (s);
If that's the case, it's an internal function problem.
var a = function (n) {function f () {return n + N;} return f ();
}; var s = a (1); Console.log (s);
The difference is that the first is a variable function, the call must be after the function definition, and the second FN () can be called before and after the function.
Usage of JS two parentheses () ()