This example is similar to what you have done in the previous example. In this example, you will be required to insert
alert in the appropriate places in order to check which part of the code is running. In some cases, you will need to pass values to the
alert method and see if the value is the one that you want.
To be honest, it would be tedious to tell you step-by-step where you should place the
alert method, especially as the bulk of the code in this example is similar to the previous one. However, to make things easier for you to follow, we'll start immediately with the entire program, after which we'll explain to you the rationale behind the location of the
alert methods and the values that ...