💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
## 1.try-catch ~~~ try{ alertt(1) }catch(err){ console.log(err.message) } //alertt is not defined ~~~ ## 2.throw ~~~ <script> var x = 1; try{ if(x==1) throw "x不能等于1" }catch(err){ console.log(err) } ~~~ ## 3.finally ~~~ var x = 1; try{ if(x==1) throw "x不能等于1" }catch(err){ console.log(err) }finally{ console.log("捕获异常结束") } ~~~