var x = 12
var y = -10
var z;
try
{
if (y == 0)
throw "Division by zero <br />";
else if (y < 0)
throw "y is < 0 <br />";
else
z = x / y;
}
catch(err)
{
document.write(err);
}
finally
{
document.write("finally - do something you must do at the end of this block of code <br />");
}
/*
run:
y is < 0
finally - do something you must do at the end of this block of code
*/