try-catch-finally

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

网页题目:try-catch-finally
URL标题:http://scyanting.com/article/geehdp.html