+ 2
How do you do exception (not event) handling in JavaScript
In python you van use a try and except block to except any errors and so the prglogram will do something if there is an error but can you do that in JavaScript
1 Odpowiedź
+ 1
var x;
try {
var x = 1;
// Error since x is already declared
} catch(e) {
console.log(e);
// Logs the error
}