alert(...) can be useful for debugging during development, but in production mode this kind of pop-up could expose sensitive information to attackers, and should never be displayed.
alert(...)
if(unexpectedCondition) { alert("Unexpected Condition"); }