How the recursion is working in the following code?
Can anyone please explain this code?
(function f(){
function f(){ return 1; }
return f();
function f(){ return 2; }
})();
I really didn't understand the recursion. I thought it will return 1 because it already returned f(), but it returned 2.