In the following example, why does the second f() prints 2.
I was thinking it would print 3 since the function prints in the same context where it is called.
(function() {
f();
f = function() {
console.log(2);
}
}());
function f() {
console.log(3);
}
f();