finally
finally{}はtryで発生したエラーの後に必ず処理する命令を指定することができます。
構文
finally { ... }
例文
<html> <head> <title>finally</title> </head> <body> <script type="text/javascript"><!-- try { v = javascript.version; document.write("Version = "+v); }catch(e){ document.write("Error = "+e); }finally{ document.write("<br>エラーが発生しました"); } // --></script> </body> </html>
関連記事
- with
- while
- var
- try
- throw
- this
- switch
- return
- new
- if
- function
- else
- do
- delete
- default
- continue
- const
- catch
- case
- break
- Comment / コメント / 注釈
スポンサーリンク