gpt4 book ai didi

javascript - 使用 ajax : possible? 记录 try{ ... } catch(e){ ... }

转载 作者:行者123 更新时间:2023-11-29 22:30:09 26 4
gpt4 key购买 nike

当我在 chrome 控制台中尝试以下操作时,我得到“未定义”作为“e”的值:

try{
var test=somethingInvalid();
}
catch(e){
console.log(e);
}

如何访问 e 的详细信息?

它有什么特点?

谢谢。


呵呵。执行 console.log('E is: '+e) 接缝工作。对不起!

最佳答案

嗯,它会返回 undefined,因为最后一行 console.log 没有返回值。

try{
false = true;
}
catch(e){
console.log(e);
}

但是在上面你还会看到一个对象 > Reference Error 后面跟着下一行 undefined

enter image description here

关于javascript - 使用 ajax : possible? 记录 try{ ... } catch(e){ ... },我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7432055/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com