A Junior Developer
So in this example, we need to remember that a function has access to variables that are defined in its calling context. The formal name of this phenomenon is the lexical scope.
As a quick reminder, the code above is a typical use of continuation-passing style (CPS)functions. The CPS function, ‘fs.readFile’, takes an extra parameter, which is a callback representing the co…