Table of contents Home page
Execute this code
try { if(confirm("Do you want to have an exception thrown?")) { // The string that is passed to the constructor will be assigned to the message property. throw new SyntaxError("An exception was thrown.") } } catch(e) { alert(e.message) }