If I call the following function
console.log("Hello World!");
I expect it to print Hello World!
and thats all fine and dandy, but what happens when I add a local function, like
console.log(target, function(err, reply) {
console.log("Hello World!")
});
It seems I can add on this local function to anything
foo(function(err, reply) {
}
I am curious
- How the local function operates inside of the other function
- Is there a certain way the local function should be handled
- Cases where this should be or shouldn't be used.