try-catch-finally

2023-06-08,,

try{
    // do sth 代码块
    throw 'test' //抛出异常
} catch(ex){
    //抛出异常时执行的语句,没有抛出异常不执行
} finally {
    //无论是否抛出异常,都执行该代码块的语句
}

《try-catch-finally.doc》

下载本文的Word格式文档,以方便收藏与打印。