Write a JavaScript program using Exception handling?
Program: <html> <head> <script type="text/javascript"> var txt=""; function message() ...

https://www.computersprofessor.com/2016/06/write-javascript-program-using.html
Program:
<html>
<head>
<script type="text/javascript">
var txt="";
function message()
{
try
{
alert("Welcome
guest!");
}
catch(err)
{
txt="There was an error
on this page.\n\n";
txt+="Error
description: " + err.description + "\n\n";
txt+="Click OK to
continue.\n\n";
alert(txt);
}
}
</script>
</head>
<body>
<input type="button" value="View message" onClick="message()" />
</body>
</html>
Out Put: