Debugging Programs

Chapter 7 details several ways to debug
JavaScript code in a web page
This code oroganally resulted in an endless loop

var count = 1;
while (count <= 10) {
window.alert("The number is " + count);
}

If executed in its original form
it would have generated endless alert
boxes containing the number 1.
By analyzing it before running the script
I was able to look at the steps and see
the error and fix it.

back