January 2020
Intermediate to advanced
470 pages
11h 13m
English
Let's start with a common problem. When debugging code, you usually need to add some kind of logging information to see if a function was called, with what arguments, what it returned, and so on. (Yes, of course, you can simply use a debugger and set breakpoints, but bear with me for this example!) Working normally, this means that you'll have to modify the code of the function itself, both at entry and on exit, to produce some logging output. For example, your original code could be something like the following:
function someFunction(param1, param2, param3) { // do something // do something else // and a bit more, // and finally return some expression;}
In this case, you would have to modify so that it looks something like the following. ...