Development work does not only require you to write 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; print them in the console only in specific situations.
When a solution is complex, debugging provides the opportunity to pause the execution and inspect state of the ...