<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JavaScript try...finally statement</title>
</head>
<body>
<pre> <!-- Use pre element for work document.writeln() method -->
<script>
function welcome(){
document.writeln("welcome() : Hello world!");
}
function bye(){
document.writeln("bye() : Good bye!");
}
try{
welcome()
}
finally{
bye()
}
</script>
</pre>
</body>
</html>