The try statement lets you test a block of code for errors. you may put those statements where exceptions or errors may occured.
The catch statement lets you handle the error.
The throw statement used to raise your own exception or custom errors.
The finally statement will execute whether an exception or error raise or not.
alert(“invalid keyword ” +err);
<input type=”button” value=”Run” onclick=”test()”>
Errors- Additional Details
<!– three variables msg, url and line here –>
window.onerror = function (msg, url, line)
alert(“Dcoument Name: ” + url + “At Line Number ” + line );
<input type=”button” value=”Test Error” onclick=”test()” />