The try statement allows you to define a block of code to be
tested for errors while it is being executed.
The catch statement allows you to define a block of code to be executed, if an error occurs in the try block.
The JavaScript statements try and catch come in pairs.
The catch statement allows you to define a block of code to be executed, if an error occurs in the try block.
The JavaScript statements try and catch come in pairs.
Syntax
try
{
//Run some code here
}
catch(err)
{
//Handle errors here
}
{
//Run some code here
}
catch(err)
{
//Handle errors here
}
Comments
Post a Comment