The only other use that these dialogs have is in sample scripts where the sample may use an alert as a placeholder for whatever code would go at that point in a complete script.
To use an alert for debugging purposes you can either have it display a fixed value to tell you that the script execution actually passed through that spot in the code or you can display a variable in order to see what value it contained at that time.
This dialog differs from the alert in that it contains one extra button labelled 'Cancel'. This call also returns a value which will be false if the Cancel button was pressed and True otherwise (either the Ok button was pressed or the option to disable future dialogs was selected).
This dialog is unlikely to get used very much. About the only time I can think of where it would be useful is if you are trying to debug code that is getting stuck in a loop using a browser that still hasn't added the additional debugging options to the dialogs. In that instance you could use the following to allow the Cancel button to force the script out of the loop.
if (!confirm(x)) break;
There are other dialogs that are also built into browsers but those now serve no useful purpose and so should not be used.
This article written by Stephen Chapman, Felgall Pty Ltd.