Posted by: dev P June 21, 2016
Solve this - iii
Login in to Rate this Post:     0       ?        
Its easy bro, output is 1. Its because you have passed 1 as argument in closure, 'x' will have value 1. As in Javacript inner function has access to its parent function variables, so value of x inside inner function will stay 1. Its easy(not tricky) because variable value has not been overidden as you are using 'y' as argument in inner function.
Read Full Discussion Thread for this article