0
function abc(a){ return(function(y){ return y+1; }) (++a)+a; } alert(abc(2));
//output= 7 //do u have any explanation?
2 Answers
+ 11
You put an argument a as 2. a gets pre-incremented by one and so now equals 3. You add up 3+3 and get 6. But you asked the function to return the result plus one (return y+1) and so you receive 7 in the end.
0
Try formatting the code in the description