try...catch
2022年5月1日小于 1 分钟
try...catch
Question
What does the code snippet to the right output by console.log
?
Snippet
var a = 'a'
try {
throw new Error('BFE.dev')
} catch {
var a = 'a1'
}
console.log(a)
var b = 'b'
try {
throw new Error('BFE.dev')
} catch (b) {
var b = 'b1'
}
console.log(b)
var c = 'c'
try {
throw new Error('BFE.dev')
} catch (error) {
var c = 'c1'
}
console.log(c)