In the below snippet, was f1 accessible from f2, because f1 was in the scope chain for f2?
There are lots of articles that say greet
would be accessible from f2 because it is in the scope chain, but how was f1 accessible?
var greet = "hello";
function f1() {return greet;}
function f2() {console.log(f1());}
f2(); // hello
EDIT:
To clarify, I am new to JS; read that when a function is invoked, an Execution Context (EC) is prepared for the function, and the EC has a scope chain (including other things). Was f2 able to access f1 from its EC's scope chain?