At some point or another, you'll have to debug your code. You might do well enough with just a bit of logging (using the console object, as we saw earlier at the beginning of the Adding logging with Winston section), but using a more powerful debugger is a great help. In this recipe, let's see how you can do real-time debugging with breakpoints, inspection of variables, and so on, so that you won't be limited to just trying to deduce what's wrong by looking at console logs.
Debugging your code
How to do it...
There are two ways of doing debugging; let's see both methods here.
If you just want to stay in your IDE, Visual Studio Code lets you directly start a debugging session. Just click on the code...