以下是我试图在JavaScript中解决此问题的Python代码:
fopen
我正在寻找与Python中“except”等效的关键字。
答案 0 :(得分:1)
在javascript中,我们有try
,catch
和finally
。
try {
//may throw
} catch(ex) {
//handle the error, where ex or what ever you choose to call it is your exception reference
} finally {
//perform this code regardless
}