Tracking down bugs with alert()

Clicking the Calculate price button causes an alert message to pop up and display values of variables involved in an incorrect calculation.

Examining values at different stages throughout a complex calculation helps you pinpoint faulty logic.