0
I didn't understand the use of catch(...) statement in exception handling. Can somebody explain this?
what is the difference between "catch(exception name)" and "catch(...)"
4 Answers
+ 10
catch â A program catches an exception with an exception handler at the place in a program where you want to handle the problem. The catch keyword indicates the catching of an exception.
try { // protected code }
catch( ExceptionName e1 ) { // catch block }
catch( ExceptionName e2 ) { // catch block }
catch( ExceptionName eN ) { // catch block }
+ 7
try{
if(x =="")throw "empty"
}
catch(err){
x.innerHTML=err
}
with try you can try code
and catch is catch your error in this example i create custom error when input is empty
read this link
https://www.w3schools.com/js/js_errors.asp
0
my question was catch(...). catch with ellipses in it...