Development work does not only require you to design the solution for a problem and write the code for it. To make sure your solution solves the problem, you have to test it. Testing involves making sure every component making up your solution behaves as expected in expected and unexpected situations.
The most practical way to test code is to inspect values of intermediary variables by logging them and printing them in the console in specific situations.
When a solution is complex, debugging provides the opportunity to pause the execution and inspect the state of the variables. ...