Debugging JavaScript: Throw Away Your Alerts!
One JavaScript statement that rarely surfaces in the wild is throw(). The throw statement allows you to throw a formal error — sending details of the error to the browser’s error console — and halting further execution of the script….
